From 64ada18b0117154ef0dab3ac6295853d23596464 Mon Sep 17 00:00:00 2001 From: Ray Green Date: Mon, 4 Jan 2021 21:41:38 +0800 Subject: [PATCH] x/evm: move SetParams execution location in InitGenesis (#685) * fix-init-evm-genesis-panic * go fmt file --- x/evm/genesis.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/x/evm/genesis.go b/x/evm/genesis.go index 31d0b22c..02189426 100644 --- a/x/evm/genesis.go +++ b/x/evm/genesis.go @@ -16,6 +16,8 @@ import ( // InitGenesis initializes genesis state based on exported genesis func InitGenesis(ctx sdk.Context, k Keeper, accountKeeper types.AccountKeeper, data GenesisState) []abci.ValidatorUpdate { // nolint: interfacer + k.SetParams(ctx, data.Params) + evmDenom := data.Params.EvmDenom for _, account := range data.Accounts { @@ -55,7 +57,6 @@ func InitGenesis(ctx sdk.Context, k Keeper, accountKeeper types.AccountKeeper, d } k.SetChainConfig(ctx, data.ChainConfig) - k.SetParams(ctx, data.Params) // set state objects and code to store _, err = k.Commit(ctx, false)