This repository has been archived by the owner on Apr 4, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 566
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(evm): Deprecate x/params usage in x/evm (#1472)
* imp(evm): Migrate from old Cosmos SDK params module to new way of keeping params in module Keeper * Updated changelog * Apply changes from code review * (impv): Added Shanghai and Cancun blocks to current types and latest migration * (tests): Update unit tests to include Shanghai and Cancun blocks * (fix) - ran golangci-lint on the entire project * (fix) - remove deprecated params method * (impv): added marshaling of booleans per individual param key * (impv): added individual param getting and setting * (impv): replaced getters with individual param * (impv): added amino codec for MsgEthereumTx * Added changes suggested in code review * (fix): updated the migration files for v4 * (fix): fixed unit tests panic for incorrect interface * (fix): updated module msg handler * (fix): rename to original params getter method * (refactor): registered implementation for the new msg * (refactor): added correct amino codec for MsgUpdateParams and removed for MsgEthTx * Applied changes from code review * (fix): removed unnecessary duplicate * (fix): removed params_legacy from the types and moved logic to migration * (fix): Added v4 mocks to the migrations_test * (fix): undo all the non related work regarding the Cancun and Shanghai blocks * (fix): reverted linting the entire project - will make a separate PR for it * Applied changes from review * Applied changes from code review * (fix): removed comments * (fix): Ran formatter and fixed linting issues on unsed functions * (fix): Linting issues resolved * (fix): refactor migrations and added default EIPs * (fix): Combined into one call * (fix): Added more straightforward way to handle migration * (fix): corrected migration test * Applied changes from code review * (fix): Linter fix * (fix): Linter * (fix): Lint proto files * Apply suggestions from code review Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com> * (fix): Added new block to migration * (fix): Added additional comments and formatted proto files * (fix): Added name to unit test cases * (fix): removed unused import * Apply changes from code review * (fix): typo * (fix): remove HTTP endpoint exposure * Apply suggestions from code review Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com> * applied changes from code review * fix: extra line added in merge removed * fix: applied changes from code review Co-authored-by: MalteHerrmann <42640438+MalteHerrmann@users.noreply.github.com> Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
- Loading branch information
1 parent
e4ac0c9
commit 0f7bdce
Showing
34 changed files
with
5,985 additions
and
367 deletions.
There are no files selected for viewing
This file contains 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 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 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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 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 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 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package keeper_test | ||
|
||
import ( | ||
sdk "github.com/cosmos/cosmos-sdk/types" | ||
evmkeeper "github.com/evmos/ethermint/x/evm/keeper" | ||
v4types "github.com/evmos/ethermint/x/evm/migrations/v4/types" | ||
"github.com/evmos/ethermint/x/evm/types" | ||
) | ||
|
||
type mockSubspace struct { | ||
ps v4types.V4Params | ||
} | ||
|
||
func newMockSubspace(ps v4types.V4Params) mockSubspace { | ||
return mockSubspace{ps: ps} | ||
} | ||
|
||
func (ms mockSubspace) GetParamSetIfExists(_ sdk.Context, ps types.LegacyParams) { | ||
*ps.(*v4types.V4Params) = ms.ps | ||
} | ||
|
||
func (suite *KeeperTestSuite) TestMigrations() { | ||
legacySubspace := newMockSubspace(v4types.DefaultParams()) | ||
migrator := evmkeeper.NewMigrator(*suite.app.EvmKeeper, legacySubspace) | ||
|
||
testCases := []struct { | ||
name string | ||
migrateFunc func(ctx sdk.Context) error | ||
}{ | ||
{ | ||
"Run Migrate3to4", | ||
migrator.Migrate3to4, | ||
}, | ||
} | ||
|
||
for _, tc := range testCases { | ||
suite.Run(tc.name, func() { | ||
err := tc.migrateFunc(suite.ctx) | ||
suite.Require().NoError(err) | ||
}) | ||
} | ||
} |
This file contains 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
Oops, something went wrong.