Conversation
Co-authored-by: moiz-sgtradex <moiz.shaikh@sgtradextech.com>
WalkthroughThe changes update the Changes
Sequence Diagram(s)sequenceDiagram
participant Caller
participant issueToTokenRegistry
participant TrustVC_Mint
Caller->>issueToTokenRegistry: Call with parameters
issueToTokenRegistry->>TrustVC_Mint: mint(tokenRegistryAddress, wallet, beneficiary, holder, tokenId, remark, key, options)
TrustVC_Mint-->>issueToTokenRegistry: Transaction object
issueToTokenRegistry-->>Caller: Awaited transaction result
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Actionable comments posted: 2
♻️ Duplicate comments (1)
src/implementations/token-registry/issue-astron.test.ts (1)
31-108: Test refactoring looks good.The test suite is properly updated to work with the new mint function implementation.
🧹 Nitpick comments (1)
src/implementations/token-registry/issue-astrontestnet.test.ts (1)
31-108: Consider refactoring to reduce code duplication across test files.This test file has identical structure and test cases as
issue.test.tsandissue-astron.test.ts, with only the network name and fetch mock differing. Consider extracting common test logic into shared test utilities.Would you like me to suggest a refactored structure using shared test utilities to reduce duplication across these test files?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (5)
package.json(1 hunks)src/implementations/token-registry/issue-astron.test.ts(5 hunks)src/implementations/token-registry/issue-astrontestnet.test.ts(5 hunks)src/implementations/token-registry/issue.test.ts(3 hunks)src/implementations/token-registry/issue.ts(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
src/implementations/token-registry/issue.ts (1)
src/utils.ts (2)
canEstimateGasPrice(99-109)getGasFees(62-69)
src/implementations/token-registry/issue-astron.test.ts (2)
src/utils.ts (1)
addAddressPrefix(12-12)src/implementations/token-registry/issue.ts (1)
issueToTokenRegistry(12-52)
src/implementations/token-registry/issue-astrontestnet.test.ts (2)
src/utils.ts (1)
addAddressPrefix(12-12)src/implementations/token-registry/issue.ts (1)
issueToTokenRegistry(12-52)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: Tests / Run Tests
🔇 Additional comments (3)
src/implementations/token-registry/issue.ts (2)
41-51: LGTM! Clean refactoring to use the mint abstraction.The migration from direct contract interaction to using the
mintfunction from@trustvc/trustvcsimplifies the code and properly encapsulates the minting logic. All parameters are correctly passed, and transaction handling is preserved.
31-39: Type assertions on gas fees are requiredgetGasFees returns an Overrides object (fields typed as BigNumberish) while transactionOptions is explicitly declared to accept BigNumber. Since scaleBigNumber and calculateMaxFee both return BigNumber, the
as BigNumberassertions are necessary to satisfy the current typing. No changes needed here—mint integration looks good.src/implementations/token-registry/issue.test.ts (1)
7-109: LGTM! Test suite properly refactored for the mint function.The test refactoring correctly aligns with the implementation changes:
- Mock setup properly represents the
mintfunction from@trustvc/trustvc- All test scenarios are preserved and updated appropriately
- Assertions correctly verify the mint function parameters and behavior
|
🎉 This PR is included in version 3.2.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Summary
fix mint function to use trustvc mint
Summary by CodeRabbit
Chores
Refactor
Tests