mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 05:14:14 +00:00
Transaction: Remove no longer used setupComputation
The last caller of `setupComputation` is gone, now that it's been replaced by the single entry point for all EVM calls, `runComputation`. With this removal, EVM's `Computation` type should no longer be used anywhere outside the call module (except in some tests and the EVM itself). Signed-off-by: Jamie Lokier <jamie@shareable.org>
This commit is contained in:
parent
8b4f5a1103
commit
beb750b8df
@ -110,7 +110,7 @@ proc initialAccessListEIP2929(call: CallParams) =
|
||||
for key in account.storageKeys:
|
||||
db.accessList(account.address, UInt256.fromBytesBE(key))
|
||||
|
||||
proc setupCall(call: CallParams, useIntrinsic: bool): TransactionHost =
|
||||
proc setupHost(call: CallParams): TransactionHost =
|
||||
let vmState = call.vmState
|
||||
vmState.setupTxContext(
|
||||
origin = call.origin.get(call.sender),
|
||||
@ -119,7 +119,7 @@ proc setupCall(call: CallParams, useIntrinsic: bool): TransactionHost =
|
||||
)
|
||||
|
||||
var intrinsicGas: GasInt = 0
|
||||
if useIntrinsic and not call.noIntrinsic:
|
||||
if not call.noIntrinsic:
|
||||
intrinsicGas = intrinsicGas(call, vmState.fork)
|
||||
|
||||
let host = TransactionHost(
|
||||
@ -147,14 +147,11 @@ proc setupCall(call: CallParams, useIntrinsic: bool): TransactionHost =
|
||||
host.computation = newComputation(vmState, cMsg)
|
||||
return host
|
||||
|
||||
proc setupComputation*(call: CallParams): Computation =
|
||||
return setupCall(call, false).computation
|
||||
|
||||
proc runComputation*(call: CallParams): CallResult =
|
||||
let host = setupCall(call, true)
|
||||
let host = setupHost(call)
|
||||
let c = host.computation
|
||||
|
||||
# Must come after `setupCall` for correct fork.
|
||||
# Must come after `setupHost` for correct fork.
|
||||
if not call.noAccessList:
|
||||
initialAccessListEIP2929(call)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user