Skip to content

fix: Resolve duplicate definition, logical checks, and error handling…#374

Closed
Himess wants to merge 1 commit intostoryprotocol:devfrom
Himess:dev
Closed

fix: Resolve duplicate definition, logical checks, and error handling…#374
Himess wants to merge 1 commit intostoryprotocol:devfrom
Himess:dev

Conversation

@Himess
Copy link

@Himess Himess commented Jan 1, 2025

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.

Copy link
Contributor

@bonnie57 bonnie57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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! 🚀

@bonnie57 bonnie57 closed this Mar 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants