fix: Resolve duplicate definition, logical checks, and error handling… #374
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR improves the NftClient class to address and resolve the following issues:
1- Duplicate Definition:
Removed duplicate definition of mintFeeRecipient in the createNFTCollection method.
2- Improved Logical Check:
Added independent validation for mintFee to ensure it is not negative.
Verified mintFeeToken is a valid address when provided.
3- Enhanced Error Handling:
Ensured handleError calls return undefined in case of errors, maintaining consistency.
Test Plan
1- Validate createNFTCollection with valid inputs:
-Include valid mintFee and mintFeeToken.
-Confirm correct contract creation.
2- Test createNFTCollection with invalid mintFee:
Provide negative values and verify proper error handling.
3- Test createNFTCollection with invalid mintFeeToken:
Use an invalid address and confirm expected error messages.
4- Simulate handleError cases by providing invalid txOptions and ensure undefined is returned gracefully.
Related Issue
None.
Notes
-Ensure appropriate test cases are added for all validation scenarios.
-Review additional documentation and logs related to mintFeeRecipient to confirm correct usage.