evm: various fixes (#319)

* evm: use prefix stores, move SetBlockBloom to EndBlock, bug fixes

* add logs to genesis state

* log tests

* commit and finalize on InitGenesis

* validate TransactionLogs

* changelog

* fix test-import

* fix lint

* add more tests
This commit is contained in:
Federico Kunze
2020-06-04 06:40:21 -04:00
committed by GitHub
parent 446eb0a3b7
commit 427e96c1de
23 changed files with 352 additions and 197 deletions
+4 -3
View File
@@ -236,9 +236,10 @@ func (suite *EvmTestSuite) TestHandlerLogs() {
suite.Require().Equal(len(resultData.Logs[0].Topics), 2)
hash := []byte{1}
suite.app.EvmKeeper.SetTransactionLogs(suite.ctx, hash, resultData.Logs)
err = suite.app.EvmKeeper.SetLogs(suite.ctx, ethcmn.BytesToHash(hash), resultData.Logs)
suite.Require().NoError(err)
logs, err := suite.app.EvmKeeper.GetTransactionLogs(suite.ctx, hash)
logs, err := suite.app.EvmKeeper.GetLogs(suite.ctx, ethcmn.BytesToHash(hash))
suite.Require().NoError(err, "failed to get logs")
suite.Require().Equal(logs, resultData.Logs)
@@ -273,7 +274,7 @@ func (suite *EvmTestSuite) TestQueryTxLogs() {
// get logs by tx hash
hash := resultData.TxHash.Bytes()
logs, err := suite.app.EvmKeeper.GetTransactionLogs(suite.ctx, hash)
logs, err := suite.app.EvmKeeper.GetLogs(suite.ctx, ethcmn.BytesToHash(hash))
suite.Require().NoError(err, "failed to get logs")
suite.Require().Equal(logs, resultData.Logs)