laconicd-deprecated/x/evm/module_test.go
Federico Kunze 261f86fdf2
bump SDK to v0.39.1 (#386)
* bump sdk version to v0.39.0 candidate

* updates

* update evm

* bump commit

* more changes

* build

* genesis

* fix tests

* fix tests

* bump commit

* bump commit

* bump commit

* add keygen func

* bump version to 0.39.0-rc0

* update AnteHandler

* fix TxDecoder

* lint

* fix test

* update statedb

* changelog

* fixes

* remove extra files

* update make test-import

* rename test

* bump SDK version to final release

* update to 0.39.1-rc1

* fix evm tests

* update RPC

* minor fixes

* update to rc2

* bump to v0.39.1

* fix personal API

* fix string type cast ambiguity (#449)

* init

* fix estimate gas test

* minor genesis change

* remove comments from unstable commit (stargate release)

Co-authored-by: Alessio Treglia <quadrispro@ubuntu.com>
2020-08-23 17:41:54 -04:00

36 lines
881 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"
}
]
}`
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)
}