forked from cerc-io/laconicd-deprecated
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:
parent
089afe41a8
commit
770ce367ac
@ -1,10 +1,8 @@
|
|||||||
package types
|
package types
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
ethcmn "github.com/ethereum/go-ethereum/common"
|
|
||||||
ethermint "github.com/tharsis/ethermint/types"
|
ethermint "github.com/tharsis/ethermint/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -13,10 +11,6 @@ func (ga GenesisAccount) Validate() error {
|
|||||||
if err := ethermint.ValidateAddress(ga.Address); err != nil {
|
if err := ethermint.ValidateAddress(ga.Address); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if len(ethcmn.Hex2Bytes(ga.Code)) == 0 {
|
|
||||||
return errors.New("code cannot be empty")
|
|
||||||
}
|
|
||||||
|
|
||||||
return ga.Storage.Validate()
|
return ga.Storage.Validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,7 +52,11 @@ func (suite *GenesisTestSuite) TestValidateGenesisAccount() {
|
|||||||
{
|
{
|
||||||
"empty account address bytes",
|
"empty account address bytes",
|
||||||
GenesisAccount{
|
GenesisAccount{
|
||||||
Address: ethcmn.Address{}.String(),
|
Address: "",
|
||||||
|
Code: suite.code,
|
||||||
|
Storage: Storage{
|
||||||
|
NewState(suite.hash, suite.hash),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
false,
|
false,
|
||||||
},
|
},
|
||||||
@ -61,8 +65,11 @@ func (suite *GenesisTestSuite) TestValidateGenesisAccount() {
|
|||||||
GenesisAccount{
|
GenesisAccount{
|
||||||
Address: suite.address,
|
Address: suite.address,
|
||||||
Code: "",
|
Code: "",
|
||||||
|
Storage: Storage{
|
||||||
|
NewState(suite.hash, suite.hash),
|
||||||
},
|
},
|
||||||
false,
|
},
|
||||||
|
true,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user