forked from cerc-io/laconicd-deprecated
792c1ff756
* evm: params * setup * bump commit * fixes * increase gas usage * tests * evm denom param * more config updates * update genesis * update ante handler * csdb param test * more tests and fixes * update statedb.Copy * lint * additional test * fix importer tests * fix AnteHandler test * minor update * revert * undo gas update * stringer test * changelog * fix csdb index error (#493) * attempt to fix * cleanup * add idx check * update csdb.Copy * update default hash * update querier * update rpc tests * fix estimate gas test Co-authored-by: noot <36753753+noot@users.noreply.github.com> Co-authored-by: noot <elizabethjbinks@gmail.com>
39 lines
922 B
Go
39 lines
922 B
Go
package evm_test
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"github.com/cosmos/ethermint/x/evm"
|
|
|
|
"github.com/ethereum/go-ethereum/common"
|
|
)
|
|
|
|
var testJSON = `{
|
|
"accounts": [
|
|
{
|
|
"address": "0x00cabdd44664b73cfc3194b9d32eb6c351ef7652",
|
|
"balance": 34
|
|
},
|
|
{
|
|
"address": "0x2cc7fdf9fde6746731d7f11979609d455c2c197a",
|
|
"balance": 0,
|
|
"code": "0x60806040"
|
|
}
|
|
],
|
|
"params": {
|
|
"evm_denom": "aphoton"
|
|
}
|
|
}`
|
|
|
|
func (suite *EvmTestSuite) TestInitGenesis() {
|
|
am := evm.NewAppModule(suite.app.EvmKeeper, suite.app.AccountKeeper)
|
|
in := json.RawMessage([]byte(testJSON))
|
|
_ = am.InitGenesis(suite.ctx, in)
|
|
|
|
testAddr := common.HexToAddress("0x2cc7fdf9fde6746731d7f11979609d455c2c197a")
|
|
|
|
res := suite.app.EvmKeeper.CommitStateDB.WithContext(suite.ctx).GetCode(testAddr)
|
|
expectedCode := common.FromHex("0x60806040")
|
|
suite.Require().Equal(expectedCode, res)
|
|
}
|