diff --git a/cosmos/x/evm/plugins/state/genesis.go b/cosmos/x/evm/plugins/state/genesis.go index 66720f9e3..b456587eb 100644 --- a/cosmos/x/evm/plugins/state/genesis.go +++ b/cosmos/x/evm/plugins/state/genesis.go @@ -48,9 +48,6 @@ func (p *plugin) InitGenesis(ctx sdk.Context, ethGen *core.Genesis) { p.SetState(address, k, v) } } - if account.Nonce != 0 { - p.SetNonce(address, account.Nonce) - } } p.Finalize() } @@ -71,7 +68,6 @@ func (p *plugin) ExportGenesis(ctx sdk.Context, ethGen *core.Genesis) { account.Storage = make(map[common.Hash]common.Hash) } account.Balance = p.GetBalance(address) - account.Nonce = p.GetNonce(address) ethGen.Alloc[address] = account return false }) @@ -89,23 +85,6 @@ func (p *plugin) ExportGenesis(ctx sdk.Context, ethGen *core.Genesis) { account.Code = p.GetCode(address) account.Balance = p.GetBalance(address) - account.Nonce = p.GetNonce(address) - ethGen.Alloc[address] = account - - return false - }) - - // Iterate Code and set the genesis accounts. - p.IterateCode(func(address common.Address, codeHash common.Hash) bool { - account, ok := ethGen.Alloc[address] - if !ok { - account = core.GenesisAccount{} - } - account.Code = p.GetCode(address) - account.Nonce = p.GetNonce(address) - if account.Balance == nil { - account.Balance = big.NewInt(0) - } ethGen.Alloc[address] = account return false diff --git a/cosmos/x/evm/plugins/state/plugin.go b/cosmos/x/evm/plugins/state/plugin.go index bf6504c8f..aa298bbc2 100644 --- a/cosmos/x/evm/plugins/state/plugin.go +++ b/cosmos/x/evm/plugins/state/plugin.go @@ -362,27 +362,6 @@ func (p *plugin) SetCode(addr common.Address, code []byte) { } } -// IterateCode iterates over all the contract code, and calls the given function. -func (p *plugin) IterateCode(fn func(addr common.Address, value common.Hash) bool) { - it := storetypes.KVStorePrefixIterator( - p.cms.GetKVStore(p.storeKey), - []byte{types.CodeHashKeyPrefix}, - ) - defer func() { - if err := it.Close(); err != nil { - p.savedErr = err - } - }() - - for ; it.Valid(); it.Next() { - k := it.Key() - addr := AddressFromCodeHashKey(k) - if fn(addr, p.GetCodeHash(addr)) { - break - } - } -} - // ============================================================================= // Storage // =============================================================================