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
+2 -7
View File
@@ -147,10 +147,9 @@ func NewEthermintApp(
keys := sdk.NewKVStoreKeys(
bam.MainStoreKey, auth.StoreKey, bank.StoreKey, staking.StoreKey,
supply.StoreKey, mint.StoreKey, distr.StoreKey, slashing.StoreKey,
gov.StoreKey, params.StoreKey, evidence.StoreKey, evm.CodeKey, evm.StoreKey,
gov.StoreKey, params.StoreKey, evidence.StoreKey, evm.StoreKey,
faucet.StoreKey,
)
blockKey := sdk.NewKVStoreKey(evm.BlockKey)
tkeys := sdk.NewTransientStoreKeys(params.TStoreKey)
@@ -203,7 +202,7 @@ func NewEthermintApp(
app.subspaces[crisis.ModuleName], invCheckPeriod, app.SupplyKeeper, auth.FeeCollectorName,
)
app.EvmKeeper = evm.NewKeeper(
app.cdc, blockKey, keys[evm.CodeKey], keys[evm.StoreKey], app.AccountKeeper,
app.cdc, keys[evm.StoreKey], app.AccountKeeper,
app.BankKeeper,
)
// TODO: use protobuf
@@ -299,10 +298,6 @@ func NewEthermintApp(
app.MountKVStores(keys)
app.MountTransientStores(tkeys)
// Mount block hash mapping key as DB (no need for historical queries)
// TODO: why does this need to be always StoreTypeDB?
app.MountStore(blockKey, sdk.StoreTypeDB)
// initialize BaseApp
app.SetInitChainer(app.InitChainer)
app.SetBeginBlocker(app.BeginBlocker)