fix: Resolve duplicate definition, logical checks, and error handling…#374
Closed
Himess wants to merge 1 commit intostoryprotocol:devfrom
Closed
fix: Resolve duplicate definition, logical checks, and error handling…#374Himess wants to merge 1 commit intostoryprotocol:devfrom
Himess wants to merge 1 commit intostoryprotocol:devfrom
Conversation
bonnie57
reviewed
Mar 3, 2025
Contributor
bonnie57
left a comment
There was a problem hiding this comment.
Hi @Himess,
Thank you so much for your contribution and for taking the time to submit this PR! We really appreciate your effort and insights.
It looks like the code in this PR is outdated, and we’ve already addressed the documentation errors and logical checks. Additionally, we avoid returning undefined in this case because if a transaction log is missing, it likely indicates an error that should be visible to the user for debugging and fixing.
For now, I’ll go ahead and close this PR, but please don’t hesitate to reach out if you have any further suggestions or questions. Your contributions are always welcome!
Thanks again for your support and for helping us improve! 🚀
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.