-
Notifications
You must be signed in to change notification settings - Fork 122
⬆️ Update mint module to align on latest cosmos-sdk v0.50.6 #645
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
Conversation
Warning Rate Limit Exceeded@bdeneux has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 17 minutes and 8 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe recent updates to the mint module in the Cosmos SDK project involve renaming variables for consistency, updating import paths, refining method signatures, and reorganizing imports. These changes enhance code readability and maintainability. Additionally, the validation logic has been refactored, and new methods and constants have been introduced for improved functionality and modularization. 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.
LGTM! Thanks 🙏
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.
Great! Thanks 😌
f4b0841
to
afab832
Compare
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: 2
Review Details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files ignored due to path filters (5)
docs/command/axoned_query.md
is excluded by!docs/command/**/*.md
docs/command/axoned_query_mint.md
is excluded by!docs/command/**/*.md
docs/command/axoned_query_mint_annual-provisions.md
is excluded by!docs/command/**/*.md
docs/command/axoned_query_mint_inflation.md
is excluded by!docs/command/**/*.md
docs/command/axoned_query_mint_params.md
is excluded by!docs/command/**/*.md
Files selected for processing (11)
- x/mint/keeper/genesis.go (1 hunks)
- x/mint/keeper/genesis_test.go (1 hunks)
- x/mint/keeper/keeper.go (5 hunks)
- x/mint/keeper/keeper_test.go (2 hunks)
- x/mint/keeper/msg_server.go (1 hunks)
- x/mint/module.go (6 hunks)
- x/mint/module_test.go (1 hunks)
- x/mint/testutil/app_config.go (1 hunks)
- x/mint/types/genesis.go (1 hunks)
- x/mint/types/keys.go (2 hunks)
- x/mint/types/minter.go (2 hunks)
Files skipped from review due to trivial changes (3)
- x/mint/keeper/genesis.go
- x/mint/testutil/app_config.go
- x/mint/types/keys.go
Additional comments not posted (16)
x/mint/module_test.go (1)
11-13
: Updated import paths to reflect new module structure.x/mint/keeper/msg_server.go (1)
15-24
: UpdatedmsgServer
struct andNewMsgServerImpl
function to use new receiver variable name for consistency.x/mint/keeper/genesis_test.go (1)
73-73
: Updated parameters forNewMinter
in test to reflect changes in initialization logic.Verification successful
The
NewMinter
function is defined inx/mint/types/minter.go
with the following signature:func NewMinter(inflation, annualProvisions math.LegacyDec) Minter {This matches the updated call in the test file
x/mint/keeper/genesis_test.go
:genesisState.Minter = types.NewMinter(math.LegacyNewDecWithPrec(20, 2), math.LegacyNewDec(1))The parameters
math.LegacyNewDecWithPrec(20, 2)
andmath.LegacyNewDec(1)
correspond to theinflation
andannualProvisions
parameters of theNewMinter
function.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify the `NewMinter` function definition matches the updated call in tests. # Test: Search for the `NewMinter` function definition. ast-grep --lang go --pattern $'func NewMinter($_, $_) { $$$ }'Length of output: 63
Script:
#!/bin/bash # Description: Verify the `NewMinter` function definition matches the updated call in tests. # Test: Search for the `NewMinter` function definition with a more flexible pattern. ast-grep --lang go --pattern 'func NewMinter($$$) { $$$ }'Length of output: 60
Script:
#!/bin/bash # Description: Locate the `NewMinter` function definition by searching for the function name directly. # Test: Search for the `NewMinter` function name in the codebase. rg 'NewMinter' --type goLength of output: 1732
x/mint/keeper/keeper_test.go (1)
56-56
: UpdatedNewKeeper
function call to reflect the removal of theauthority
parameter, simplifying the function signature.x/mint/keeper/keeper.go (6)
8-8
: Update import path to align with new SDK version.
20-21
: Theauthority
field has been removed from theKeeper
struct, aligning with the PR description and summary.Also applies to: 26-29
47-47
: Good use of panic to handle the critical error scenario where the module account is not set.
57-57
: Theauthority
field is correctly initialized in theKeeper
struct.
71-72
: Method signatures have been updated to use the new receiver variable namek
. This change improves consistency across the module.Also applies to: 76-76, 83-84, 89-90, 95-96, 101-107, 112-113
38-38
: Ensure that thestoreService
parameter type change is reflected whereverNewKeeper
is called.Verification successful
Ensure that the
storeService
parameter type change is reflected whereverNewKeeper
is called.The extracted lines around each
NewKeeper
call show that thestoreService
parameter type change has been correctly handled in all instances.
x/mint/module.go
x/mint/keeper/keeper_test.go
x/mint/keeper/genesis_test.go
x/mint/keeper/grpc_query_test.go
x/logic/keeper/msg_server_test.go
x/logic/keeper/grpc_query_params_test.go
x/logic/keeper/grpc_query_ask_test.go
x/logic/keeper/features_test.go
app/app.go
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the `storeService` parameter type change in `NewKeeper` is correctly handled in all calls. # Test: Search for the function usage. Expect: Only occurrences of the new signature. rg --type go $'NewKeeper'Length of output: 1985
Script:
#!/bin/bash # Description: Extract lines around each `NewKeeper` call to verify the parameter types. # Extract 5 lines before and after each `NewKeeper` call to check the parameters. rg --type go -A 5 -B 5 $'NewKeeper('Length of output: 108
Script:
#!/bin/bash # Description: Extract lines around each `NewKeeper` call to verify the parameter types. # Extract 5 lines before and after each `NewKeeper` call to check the parameters. rg --type go -A 5 -B 5 'NewKeeper('Length of output: 108
Script:
#!/bin/bash # Description: Extract lines around each `NewKeeper` call to verify the parameter types. # Extract 5 lines before and after each `NewKeeper` call to check the parameters. rg --type go -A 5 -B 5 'NewKeeper\('Length of output: 16443
x/mint/module.go (6)
8-8
: Updated import paths to align with new SDK version and added new dependencies.Also applies to: 10-13, 21-22
30-30
: Introduction of a new constantConsensusVersion
to specify the module's consensus version.
58-59
: Updated method signatures to reflect changes in parameter names and types.Also applies to: 79-79
137-137
: The new methodConsensusVersion
correctly returns the newly defined constant.
170-221
: The new dependency injection setup usingModuleInputs
andModuleOutputs
is well-structured and aligns with modern Go practices.
93-99
: Ensure that the newAppModule
constructor is used correctly throughout the codebase.Verification successful
The
rg
command output shows multiple occurrences ofNewAppModule
in various files. To ensure the newAppModule
constructor is used correctly, we need to verify the relevant occurrences in thex/mint/module.go
andapp/app.go
files.
The new
AppModule
constructor is correctly used in thex/mint/module.go
file and theapp/app.go
file. The constructor is invoked with the appropriate arguments, ensuring that the new implementation is correctly integrated.
- In
x/mint/module.go
, theNewAppModule
function is defined and used correctly.- In
app/app.go
, theNewAppModule
is used with the correct parameters.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that the new `AppModule` constructor is correctly used in all relevant parts of the codebase. # Test: Search for the function usage. Expect: Only occurrences of the new constructor. rg --type go $'NewAppModule'Length of output: 3092
Script:
#!/bin/bash # Description: Verify the correct usage of the new `AppModule` constructor in the relevant files. # Extract the relevant lines from x/mint/module.go rg --type go --context 5 'NewAppModule' x/mint/module.go # Extract the relevant lines from app/app.go rg --type go --context 5 'NewAppModule' app/app.goLength of output: 4315
This PR includes the necessary updates to the Mint module to align it with the Cosmos-SDK v0.50.6. ⚙️
Key changes include:
Summary by CodeRabbit
Refactor
New Features
NewAppModule
function with updated parameters and logic.depinject.OnePerModuleType
andappmodule.AppModule
interfaces.Bug Fixes
ValidateGenesis
andValidateMinter
functions to ensure more accurate genesis state validation.Tests