Skip to content

Commit

Permalink
tests: update reference tests (ethereum#24899)
Browse files Browse the repository at this point in the history
* tests: update reference tests

* tests: fix flaw in state test execution

* f
  • Loading branch information
holiman authored and cp-wjhan committed Dec 2, 2022
1 parent 29f2f71 commit fa3315a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/state_test_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,14 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
if _, err := core.ApplyMessage(evm, msg, gaspool); err != nil {
statedb.RevertToSnapshot(snapshot)
}

// Commit block
statedb.Commit(config.IsEIP158(block.Number()))
// Add 0-value mining reward. This only makes a difference in the cases
// where
// - the coinbase suicided, or
// - there are only 'bad' transactions, which aren't executed. In those cases,
// the coinbase gets no txfee, so isn't created, and thus needs to be touched
statedb.AddBalance(block.Coinbase(), new(big.Int))
// Commit block
statedb.Commit(config.IsEIP158(block.Number()))
// And _now_ get the state root
root := statedb.IntermediateRoot(config.IsEIP158(block.Number()))
return snaps, statedb, root, nil
Expand Down

0 comments on commit fa3315a

Please sign in to comment.