Skip to content
This repository has been archived by the owner on Apr 4, 2024. It is now read-only.

Commit

Permalink
nit
Browse files Browse the repository at this point in the history
  • Loading branch information
JayT106 committed Oct 17, 2022
1 parent 8650120 commit 59c6959
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions x/evm/genesis.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,14 @@ func InitGenesis(
),
)
}

code := common.Hex2Bytes(account.Code)
codeHash := crypto.Keccak256Hash(code)

// we ignore the empty Code hash checking, see ethermint PR#1234
if len(account.Code) != 0 && !bytes.Equal(ethAcct.GetCodeHash().Bytes(), codeHash.Bytes()) {
panic(fmt.Sprintf(`the evm state code doesn't match with the codehash\n account: %s
, evm state codehash: %v, ethAccount codehash: %v, evm state code: %s\n`,
account.Address, codeHash, ethAcct.GetCodeHash(), account.Code))
s := "the evm state code doesn't match with the codehash\n"
panic(fmt.Sprintf("%s account: %s , evm state codehash: %v, ethAccount codehash: %v, evm state code: %s\n",
s, account.Address, codeHash, ethAcct.GetCodeHash(), account.Code))
}

k.SetCode(ctx, codeHash.Bytes(), code)
Expand Down

0 comments on commit 59c6959

Please sign in to comment.