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

Restore state test transaction context
This commit is contained in:
Marius van der Wijden 2024-10-16 05:54:54 +02:00 committed by GitHub
commit 56ff85a808
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 0 deletions

View File

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