-
Notifications
You must be signed in to change notification settings - Fork 111
refactor!: clean up chain config #608
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
Draft
almk-dev
wants to merge
29
commits into
main
Choose a base branch
from
config-refactor
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 3 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
feb4e74
move sdk setup to root cmd from main
almk-dev ad89741
refactor evmcoininfo and evmconfigurator
almk-dev 4d0136c
update evmcoininfo usage
almk-dev 4c1b44f
fix test
almk-dev 5e5311a
remove unnecessaty vars
almk-dev ec24949
var assignments are actually necessary
almk-dev 5596af5
add coin info to toml
almk-dev 02d01f7
add fallback for missing chain id in client.toml
almk-dev 91edb75
refactor server options
almk-dev 24c6f42
lint
almk-dev 517ae7d
add appOptions refactor
almk-dev fc87a64
add chainconfig replacement
almk-dev b80b4b7
move constants to config
almk-dev db26c46
consolidate testutil constants package into config
almk-dev 96530d5
fix testcofig in root
almk-dev 3f1368c
Merge branch 'main' into config-refactor
almk-dev 7fb9074
Merge branch 'main' into config-refactor
almk-dev b9196e4
pass in coin info flags
almk-dev 3c1f829
move around evmd files
almk-dev ea492dd
refactor keys package and clean up client dir
almk-dev 2673aaa
remove err logging without nil check
almk-dev 28b6677
add cmd extraction helper
almk-dev 54e765f
fix local node vars
almk-dev acf25cd
remove duplicate toml
almk-dev 5efe6f0
remove cmd call
almk-dev e67c604
add genesis changes
almk-dev 268df4b
update infer logic and tests
almk-dev 77dc203
fix and set evmcoininfo
vladjdk 72cdc05
move all options outside of app.go
vladjdk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1602,12 +1602,12 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { | |
| chainConfig.CancunTime = &maxInt | ||
| chainConfig.PragueTime = &maxInt | ||
|
|
||
| configurator := types.NewEVMConfigurator() | ||
| configurator := types.NewEvmConfig() | ||
| configurator.ResetTestConfig() | ||
| err := configurator. | ||
| WithChainConfig(chainConfig). | ||
| WithEVMCoinInfo(testconstants.ExampleChainCoinInfo[testconstants.ExampleChainID]). | ||
| Configure() | ||
| Apply() | ||
| s.Require().NoError(err) | ||
| }, | ||
| true, | ||
|
|
@@ -1632,10 +1632,9 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { | |
|
|
||
| // Save initial configure to restore it between tests | ||
| coinInfo := types.EvmCoinInfo{ | ||
| Denom: types.GetEVMCoinDenom(), | ||
| ExtendedDenom: types.GetEVMCoinExtendedDenom(), | ||
| DisplayDenom: types.GetEVMCoinDisplayDenom(), | ||
| Decimals: types.GetEVMCoinDecimals(), | ||
| DisplayDenom: types.GetEVMCoinDisplayDenom(), | ||
| Decimals: types.GetEVMCoinDecimals(), | ||
| ExtendedDecimals: types.GetEVMCoinExtendedDecimals(), | ||
| } | ||
| chainConfig := types.DefaultChainConfig(s.Network.GetEIP155ChainID().Uint64()) | ||
|
|
||
|
|
@@ -1658,12 +1657,12 @@ func (s *KeeperTestSuite) TestQueryBaseFee() { | |
| s.Require().Error(err) | ||
| } | ||
| s.Require().NoError(s.Network.NextBlock()) | ||
| configurator := types.NewEVMConfigurator() | ||
| configurator := types.NewEvmConfig() | ||
| configurator.ResetTestConfig() | ||
| err = configurator. | ||
| WithChainConfig(chainConfig). | ||
| WithEVMCoinInfo(coinInfo). | ||
| Configure() | ||
| Apply() | ||
| s.Require().NoError(err) | ||
| }) | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,16 +12,14 @@ import ( | |
| // chain id | ||
| var ChainsCoinInfo = map[uint64]evmtypes.EvmCoinInfo{ | ||
| EighteenDecimalsChainID: { | ||
| Denom: ExampleChainDenom, | ||
| ExtendedDenom: ExampleChainDenom, | ||
| DisplayDenom: ExampleDisplayDenom, | ||
| Decimals: evmtypes.EighteenDecimals, | ||
| DisplayDenom: ExampleDisplayDenom, | ||
| Decimals: evmtypes.EighteenDecimals, | ||
| ExtendedDecimals: evmtypes.EighteenDecimals, | ||
| }, | ||
| EVMChainID: { | ||
| Denom: ExampleChainDenom, | ||
| ExtendedDenom: ExampleChainDenom, | ||
| DisplayDenom: ExampleDisplayDenom, | ||
| Decimals: evmtypes.EighteenDecimals, | ||
| DisplayDenom: ExampleDisplayDenom, | ||
| Decimals: evmtypes.EighteenDecimals, | ||
| ExtendedDecimals: evmtypes.EighteenDecimals, | ||
| }, | ||
| } | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Check warning
Code scanning / CodeQL
Useless assignment to local variable Warning test
Copilot Autofix
AI about 1 month ago
The function assigns the result of
evmtypes.GetEVMCoinExtendedDecimals()to theextendedDecimalsvariable and then immediately uses it as a field value in the structevmtypes.EvmCoinInfo. Thereafter, the variable is never referenced, so its assignment is superfluous. The best fix is to eliminate theextendedDecimalsvariable completely, and directly use the function call as the value for theExtendedDecimalsfield inevmtypes.EvmCoinInfo. Only the affected lines around the variable definition and struct literal need to be changed. No imports or other changes are required.