Merge pull request #58 from shemnon/state-tests-origin

Restore state test transaction context
pull/30511/head
Marius van der Wijden 1 month ago committed by GitHub
commit 56ff85a808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      tests/state_test_util.go

@ -299,11 +299,13 @@ func (t *StateTest) RunNoVerify(subtest StateSubtest, vmconfig vm.Config, snapsh
tracer.OnTxStart(evm.GetVMContext(), nil, msg.From) tracer.OnTxStart(evm.GetVMContext(), nil, msg.From)
} }
oldContext := evm.TxContext
if config.IsPrague(new(big.Int), 0) { if config.IsPrague(new(big.Int), 0) {
for i := int(block.Number().Uint64() - 1); i >= 0; i-- { for i := int(block.Number().Uint64() - 1); i >= 0; i-- {
core.ProcessParentBlockHash(vmTestBlockHash(uint64(i)), evm, st.StateDB) core.ProcessParentBlockHash(vmTestBlockHash(uint64(i)), evm, st.StateDB)
} }
} }
evm.Reset(oldContext, st.StateDB)
// Execute the message. // Execute the message.
snapshot := st.StateDB.Snapshot() snapshot := st.StateDB.Snapshot()

Loading…
Cancel
Save