-
Notifications
You must be signed in to change notification settings - Fork 17
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
chore: multiple coins migration #187
Conversation
WalkthroughThe updates introduce significant changes to the Changes
Sequence Diagram(s) (Beta)sequenceDiagram
participant User
participant App
participant DelegationKeeper
participant FundersKeeper
participant StakersKeeper
participant UpgradeHandler
User ->> App: Initialize New()
App ->> DelegationKeeper: Pass parameters
App ->> FundersKeeper: Pass parameters
App ->> StakersKeeper: Pass parameters
User ->> UpgradeHandler: Trigger CreateUpgradeHandler()
UpgradeHandler ->> DelegationKeeper: Migrate delegations
UpgradeHandler ->> FundersKeeper: Migrate funders
UpgradeHandler ->> StakersKeeper: Migrate stakers
Poem
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.
For the testing part...
We already have the upgrade test in interchaintest/upgrades/v1_5/upgrade_test.go
.
We could just extend this test if we want to test the migration better.
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: 4
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files ignored due to path filters (6)
app/upgrades/v1_5/v1_4_types/bundles/params.pb.go
is excluded by!**/*.pb.go
app/upgrades/v1_5/v1_4_types/delegation/delegation.pb.go
is excluded by!**/*.pb.go
app/upgrades/v1_5/v1_4_types/funders/funders.pb.go
is excluded by!**/*.pb.go
app/upgrades/v1_5/v1_4_types/funders/params.pb.go
is excluded by!**/*.pb.go
app/upgrades/v1_5/v1_4_types/pool/params.pb.go
is excluded by!**/*.pb.go
app/upgrades/v1_5/v1_4_types/stakers/stakers.pb.go
is excluded by!**/*.pb.go
Files selected for processing (10)
- app/app.go (1 hunks)
- app/upgrades/v1_5/upgrade.go (2 hunks)
- app/upgrades/v1_5/v1_4_types/bundles/getters_params.go (2 hunks)
- app/upgrades/v1_5/v1_4_types/delegation/getters_delegation.go (1 hunks)
- app/upgrades/v1_5/v1_4_types/funders/getters_funding.go (1 hunks)
- app/upgrades/v1_5/v1_4_types/funders/getters_params.go (1 hunks)
- app/upgrades/v1_5/v1_4_types/pool/getters_pool.go (1 hunks)
- app/upgrades/v1_5/v1_4_types/stakers/getters_staker.go (1 hunks)
- x/funders/keeper/keeper_test.go (2 hunks)
- x/stakers/keeper/keeper.go (2 hunks)
Additional comments not posted (9)
app/upgrades/v1_5/v1_4_types/pool/getters_pool.go (1)
11-18
: The use ofMustUnmarshal
inGetParams
could lead to panics if unmarshalling fails. Ensure that this behavior is acceptable in your error handling strategy.app/upgrades/v1_5/v1_4_types/stakers/getters_staker.go (1)
12-27
: The implementation ofGetAllStakers
follows best practices for handling iterators and unmarshalling data. Good job ensuring the iterator is closed withdefer
.app/upgrades/v1_5/v1_4_types/funders/getters_params.go (1)
10-28
: BothGetParams
andSetParams
are implemented correctly. Note the use ofMustMarshal
inSetParams
, which could lead to panics if marshalling fails. Ensure that this behavior is acceptable in your error handling strategy.app/upgrades/v1_5/v1_4_types/funders/getters_funding.go (1)
11-24
: The implementation ofGetAllFundings
is robust, correctly using an iterator to fetch data and ensuring the iterator is closed. Well done.app/upgrades/v1_5/v1_4_types/delegation/getters_delegation.go (1)
11-41
: BothGetAllDelegationEntries
andGetAllDelegationData
are implemented correctly, using iterators efficiently and ensuring they are closed properly. Excellent adherence to best practices.x/stakers/keeper/keeper.go (1)
6-6
: Import ofsdk "github.com/cosmos/cosmos-sdk/types"
is correctly added to support the new functionMigration_SetStaker
.x/funders/keeper/keeper_test.go (1)
7-11
: The imports for the migration testing are correctly updated to include necessary modules and types for the funders migration.app/upgrades/v1_5/upgrade.go (1)
40-62
: TheCreateUpgradeHandler
function correctly integrates the new keepers and their migration functions. Ensure that the migration logic is thoroughly tested, especially the interactions between different modules during the upgrade process.Would you like assistance in setting up integration tests for this upgrade process?
app/app.go (1)
419-421
: TheNew
function is updated to include new keepers as parameters, aligning with the changes in the upgrade logic. This is a crucial update for the application's functionality post-upgrade.
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/funders/keeper/keeper_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- x/funders/keeper/keeper_test.go
Removed the unit tests now |
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Tests