-
Notifications
You must be signed in to change notification settings - Fork 127
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
refactor: refactor code & replace coinConvert with sdk RegisterDenom #2941
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe refactoring effort primarily involves replacing references from Changes
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.
Actionable comments posted: 1
Review Details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (11)
- app/app.go (4 hunks)
- app/genesis.go (1 hunks)
- app/keepers/keepers.go (4 hunks)
- app/params/address.go (1 hunks)
- app/params/params.go (1 hunks)
- app/sim_test.go (4 hunks)
- app/upgrades/v200/config.go (2 hunks)
- cmd/iris/cmd/root.go (7 hunks)
- cmd/iris/cmd/testnet.go (5 hunks)
- cmd/iris/main.go (1 hunks)
- modules/guardian/types/msgs_test.go (1 hunks)
Files skipped from review due to trivial changes (3)
- app/params/address.go
- app/sim_test.go
- modules/guardian/types/msgs_test.go
Additional comments not posted (11)
cmd/iris/main.go (2)
8-8
: Import ofparams
package is correctly updated.
17-17
: Usage ofparams.DefaultNodeHome
is consistent with the refactoring goal.Verification successful
Usage of
params.DefaultNodeHome
is consistent across the application.
app/params/params.go
: Definition and initialization ofDefaultNodeHome
.cmd/iris/main.go
: Usage insvrcmd.Execute
.cmd/iris/cmd/root.go
: Multiple usages in various commands and initializations.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `params.DefaultNodeHome` is used consistently across the application. # Test: Search for the usage of `DefaultNodeHome`. Expect: Only occurrences from `params`. rg --type python $'DefaultNodeHome'Length of output: 65
Script:
#!/bin/bash # Description: Verify that `params.DefaultNodeHome` is used consistently across the application. # Test: Search for the usage of `DefaultNodeHome`. Expect: Only occurrences from `params`. rg --type go 'DefaultNodeHome'Length of output: 878
app/genesis.go (1)
12-12
: Refactor ofGenesisState
to a map increases flexibility for module-specific genesis configurations.app/upgrades/v200/config.go (1)
18-18
: Correct use ofparams.EvmToken
aligns with the refactoring objectives.Verification successful
The usage of
EvmToken
appears consistent across the application, with references in multiple files indicating its integration. Here are the relevant locations:
app/params/params.go
app/upgrades/v200/config.go
app/keepers/keepers.go
cmd/iris/cmd/testnet.go
This confirms that
params.EvmToken
is correctly utilized in the refactoring process.Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `EvmToken` is used consistently across the application. # Test: Search for the usage of `EvmToken`. Expect: Only occurrences from `params`. rg --type python $'EvmToken'Length of output: 58
Script:
#!/bin/bash # Description: Verify that `EvmToken` is used consistently across the application. # Test: Search for the usage of `EvmToken`. Expect: Only occurrences from `params`. rg --type go EvmTokenLength of output: 717
cmd/iris/cmd/root.go (1)
50-50
: Updated references toparams.DefaultNodeHome
andparams.BaseToken.MinUnit
are correctly implemented.Also applies to: 106-106, 124-124, 126-126, 132-132, 137-137, 155-155, 164-164
Verification successful
The updated references to
params.DefaultNodeHome
andparams.BaseToken.MinUnit
are used consistently across the application.
cmd/iris/main.go
cmd/iris/cmd/root.go
cmd/iris/cmd/testnet.go
app/params/params.go
app/keepers/keepers.go
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `DefaultNodeHome` and `BaseToken.MinUnit` are used consistently across the application. # Test: Search for the usage of these configurations. Expect: Only occurrences from `params`. rg --type python $'DefaultNodeHome|BaseToken.MinUnit'Length of output: 85
Script:
#!/bin/bash # Description: Verify that `DefaultNodeHome` and `BaseToken.MinUnit` are used consistently across the application. # Test: Search for the usage of these configurations. Expect: Only occurrences from `params`. rg --type go 'DefaultNodeHome|BaseToken.MinUnit'Length of output: 1584
app/app.go (1)
87-87
: Updated usage ofparams.AppName
,GenesisState
, andparams.InjectCodec
are correctly implemented.Also applies to: 239-239, 362-362
Verification successful
The search results indicate that
AppName
,GenesisState
, andInjectCodec
are used in various parts of the codebase, includingapp/app.go
,app/params/params.go
, and other modules. The usage appears consistent with the refactoring goals.
AppName
is defined inapp/params/params.go
and used inapp/app.go
and other files.GenesisState
is used extensively across multiple modules, indicating its central role in the application's initialization and state management.InjectCodec
is defined inapp/params/params.go
and used inapp/app.go
.These findings confirm that the changes are correctly implemented and consistent across the application.
Scripts Executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Verify that `AppName`, `GenesisState`, and `InjectCodec` are used consistently across the application. # Test: Search for the usage of these entities. Expect: Only occurrences from `params`. rg --type python $'AppName|GenesisState|InjectCodec'Length of output: 84
Script:
#!/bin/bash # Description: Verify that `AppName`, `GenesisState`, and `InjectCodec` are used consistently across the application. # Test: Search for the usage of these entities. Expect: Only occurrences from `params`. rg --type go 'AppName|GenesisState|InjectCodec'Length of output: 10134
cmd/iris/cmd/testnet.go (2)
15-15
: Updated import fromiristypes
toparams
aligns with the PR's objective to centralize token parameters.
305-305
: Ensure that theAppConfig
function is correctly handling theBaseToken.MinUnit
from theparams
package.app/keepers/keepers.go (3)
4-4
: Updated import alias fromiristypes
toparams2
is consistent with the PR's refactoring goals.
235-235
: The update to useBech32PrefixAccAddr
fromparams2
ensures consistency in address formatting across the application.
559-564
: The configuration ofBaseToken
andEvmToken
usingparams2
aligns with the new structure and ensures correct token handling in the swap functionality.
// AppName is the name of the app | ||
AppName = "IrisApp" | ||
EIP155ChainID = "6688" |
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.
Extensive additions in params.go
introduce crucial configurations and utility functions. Ensure these are covered by unit tests.
Would you like me to help in writing unit tests for these new functions?
Also applies to: 28-34, 37-101, 103-117
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)
- app/keepers/keepers.go (3 hunks)
Files skipped from review as they are similar to previous changes (1)
- app/keepers/keepers.go
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)
- modules/guardian/types/msgs_test.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- modules/guardian/types/msgs_test.go
Summary by CodeRabbit
Refactor
iristypes
toparams
for better modularity and maintainability.Chores
These changes aim to enhance code clarity and future-proof the application by improving the organization of configuration parameters.