x/evm: set blockHash when executing function CommitStateDB.Prepare in handler (#666)

This commit is contained in:
Pierre 2020-12-24 04:15:38 +08:00 committed by GitHub
parent c15ba5300f
commit 9659b81ee1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,8 +63,8 @@ func handleMsgEthereumTx(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*s
// other nodes, causing a consensus error // other nodes, causing a consensus error
if !st.Simulate { if !st.Simulate {
// Prepare db for logs // Prepare db for logs
// TODO: block hash blockHash := types.HashFromContext(ctx)
k.CommitStateDB.Prepare(ethHash, common.Hash{}, k.TxCount) k.CommitStateDB.Prepare(ethHash, blockHash, k.TxCount)
k.TxCount++ k.TxCount++
} }
@ -149,7 +149,8 @@ func handleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk
if !st.Simulate { if !st.Simulate {
// Prepare db for logs // Prepare db for logs
k.CommitStateDB.Prepare(ethHash, common.Hash{}, k.TxCount) blockHash := types.HashFromContext(ctx)
k.CommitStateDB.Prepare(ethHash, blockHash, k.TxCount)
k.TxCount++ k.TxCount++
} }