evm: ignore code bytes validation during genesis (#512)

remove comment

Co-authored-by: Federico Kunze Küllmer <31522760+fedekunze@users.noreply.github.com>
This commit is contained in:
Jongwhan Lee 2021-09-03 01:24:21 +09:00 committed by GitHub
parent 089afe41a8
commit 770ce367ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -1,10 +1,8 @@
package types
import (
"errors"
"fmt"
ethcmn "github.com/ethereum/go-ethereum/common"
ethermint "github.com/tharsis/ethermint/types"
)
@ -13,10 +11,6 @@ func (ga GenesisAccount) Validate() error {
if err := ethermint.ValidateAddress(ga.Address); err != nil {
return err
}
if len(ethcmn.Hex2Bytes(ga.Code)) == 0 {
return errors.New("code cannot be empty")
}
return ga.Storage.Validate()
}

View File

@ -52,7 +52,11 @@ func (suite *GenesisTestSuite) TestValidateGenesisAccount() {
{
"empty account address bytes",
GenesisAccount{
Address: ethcmn.Address{}.String(),
Address: "",
Code: suite.code,
Storage: Storage{
NewState(suite.hash, suite.hash),
},
},
false,
},
@ -61,8 +65,11 @@ func (suite *GenesisTestSuite) TestValidateGenesisAccount() {
GenesisAccount{
Address: suite.address,
Code: "",
Storage: Storage{
NewState(suite.hash, suite.hash),
},
false,
},
true,
},
}