-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolve issues with mappAccounts storage #1622
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe recent updates to the Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
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 as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (7)
- x/interchainstaking/keeper/address_map.go (4 hunks)
- x/interchainstaking/keeper/address_map_test.go (3 hunks)
- x/interchainstaking/keeper/grpc_query.go (1 hunks)
- x/interchainstaking/keeper/receipt.go (2 hunks)
- x/interchainstaking/keeper/receipt_test.go (1 hunks)
- x/interchainstaking/keeper/withdrawal_record.go (1 hunks)
- x/interchainstaking/types/keys.go (2 hunks)
Additional comments not posted (10)
x/interchainstaking/keeper/address_map_test.go (1)
13-14
: Updated variable types tosdk.AccAddress
align with PR objectives for type consistency.x/interchainstaking/keeper/address_map.go (1)
10-10
: Updated function signatures to usesdk.AccAddress
enhance type safety and consistency across the module.Also applies to: 19-19, 44-44, 51-51, 60-60, 67-67
x/interchainstaking/types/keys.go (1)
96-96
: Updated key generation functions to usesdk.AccAddress
for better type consistency and safety.Also applies to: 101-101, 161-161
x/interchainstaking/keeper/grpc_query.go (1)
348-348
: UpdatedIterateUserMappedAccounts
to usesdk.AccAddress
for consistent type usage across queries.x/interchainstaking/keeper/receipt.go (1)
Line range hint
182-221
: RefactorMintAndSendQAsset
to handlesdk.AccAddress
correctly.The changes correctly implement the handling of
sdk.AccAddress
formappedAddress
, enhancing type safety and consistency with other parts of the system. The logic to handle different scenarios based on the presence of a mapped address and other conditions is well-implemented.x/interchainstaking/keeper/receipt_test.go (5)
384-406
: Add comprehensive tests forMintAndSendQAsset
.The test
TestMintAndSendQAsset1RR
correctly sets up the scenario with a redemption rate of 1.0 and checks the balance of the receiver after the operation, ensuring the function behaves as expected.
408-431
: Ensure tests cover different redemption rates.The test
TestMintAndSendQAssetNon1RR
effectively tests the function with a redemption rate of 1.1, verifying that the function correctly calculates and transfers the adjusted amount.
433-456
: Validate handling of redemption rates below 1.0.The test
TestMintAndSendQAssetSub1RR
is crucial as it checks the function's behavior when the redemption rate is 0.9, ensuring that the function increases the amount correctly.
458-493
: Test the function with a mapped account and non-standard redemption rate.The test
TestMintAndSendQAssetNon1RRMappedAccount
effectively verifies that the function handles scenarios with a mapped account and a non-1.0 redemption rate, ensuring that the assets are transferred to the correct account.
495-527
: Ensure correct handling of the "return to sender" flag with non-standard redemption rates.The test
TestMintAndSendQAssetNon1RTS
is well-designed to check the function's behavior when the "return to sender" flag is set along with a non-1.0 redemption rate, ensuring that the assets are handled correctly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- x/interchainstaking/keeper/address_map_test.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- x/interchainstaking/keeper/address_map_test.go
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1622 +/- ##
==========================================
+ Coverage 63.52% 63.58% +0.05%
==========================================
Files 194 194
Lines 13734 13733 -1
==========================================
+ Hits 8725 8732 +7
+ Misses 4160 4152 -8
Partials 849 849
Flags with carried forward coverage won't be shown. Click here to find out more.
|
1. Summary