Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
x/evm: set blockHash when executing function CommitStateDB.Prepare in…
Browse files Browse the repository at this point in the history
… handler (#666)
  • Loading branch information
summerpro committed Dec 23, 2020
1 parent c15ba53 commit 9659b81
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions x/evm/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ func handleMsgEthereumTx(ctx sdk.Context, k Keeper, msg types.MsgEthereumTx) (*s
// other nodes, causing a consensus error
if !st.Simulate {
// Prepare db for logs
// TODO: block hash
k.CommitStateDB.Prepare(ethHash, common.Hash{}, k.TxCount)
blockHash := types.HashFromContext(ctx)
k.CommitStateDB.Prepare(ethHash, blockHash, k.TxCount)
k.TxCount++
}

Expand Down Expand Up @@ -149,7 +149,8 @@ func handleMsgEthermint(ctx sdk.Context, k Keeper, msg types.MsgEthermint) (*sdk

if !st.Simulate {
// 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++
}

Expand Down

0 comments on commit 9659b81

Please sign in to comment.