Skip to content

Commit

Permalink
Merge pull request #5462 from m-Peter/fix-block-hash-inconsistency
Browse files Browse the repository at this point in the history
Move `blockHash` calculation after deduction of supply diff
  • Loading branch information
janezpodhostnik authored Feb 27, 2024
2 parents bf3cec4 + aa0c6b4 commit 97775ab
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions fvm/evm/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -300,11 +300,6 @@ func (h *ContractHandler) executeAndHandleCall(
bp.AppendTxHash(res.TxHash)
// TODO: in the future we might update the receipt hash here

blockHash, err := bp.Hash()
if err != nil {
return res, err
}

if totalSupplyDiff != nil {
if deductSupplyDiff {
bp.TotalSupply = new(big.Int).Sub(bp.TotalSupply, totalSupplyDiff)
Expand All @@ -316,6 +311,11 @@ func (h *ContractHandler) executeAndHandleCall(
}
}

blockHash, err := bp.Hash()
if err != nil {
return res, err
}

// emit events
encoded, err := call.Encode()
if err != nil {
Expand Down

0 comments on commit 97775ab

Please sign in to comment.