core: use NewEVMTxContext in ApplyTransaction

We use this function in StateProcessor, make sure ApplyTransaction does the same.
This commit is contained in:
Felix Lange 2023-10-30 18:38:25 +01:00
parent 619605e13f
commit fd5d33a33b

View file

@ -165,7 +165,8 @@ func ApplyTransaction(config *params.ChainConfig, bc ChainContext, author *commo
}
// Create a new context to be used in the EVM environment
blockContext := NewEVMBlockContext(header, bc, author)
vmenv := vm.NewEVM(blockContext, vm.TxContext{BlobHashes: tx.BlobHashes()}, statedb, config, cfg)
txContext := NewEVMTxContext(msg)
vmenv := vm.NewEVM(blockContext, txContext, statedb, config, cfg)
return applyTransaction(msg, config, gp, statedb, header.Number, header.Hash(), tx, usedGas, vmenv)
}