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:
|
for key in account.storageKeys:
|
||||||
db.accessList(account.address, UInt256.fromBytesBE(key))
|
db.accessList(account.address, UInt256.fromBytesBE(key))
|
||||||
|
|
||||||
proc setupCall(call: CallParams, useIntrinsic: bool): TransactionHost =
|
proc setupHost(call: CallParams): TransactionHost =
|
||||||
let vmState = call.vmState
|
let vmState = call.vmState
|
||||||
vmState.setupTxContext(
|
vmState.setupTxContext(
|
||||||
origin = call.origin.get(call.sender),
|
origin = call.origin.get(call.sender),
|
||||||
|
@ -119,7 +119,7 @@ proc setupCall(call: CallParams, useIntrinsic: bool): TransactionHost =
|
||||||
)
|
)
|
||||||
|
|
||||||
var intrinsicGas: GasInt = 0
|
var intrinsicGas: GasInt = 0
|
||||||
if useIntrinsic and not call.noIntrinsic:
|
if not call.noIntrinsic:
|
||||||
intrinsicGas = intrinsicGas(call, vmState.fork)
|
intrinsicGas = intrinsicGas(call, vmState.fork)
|
||||||
|
|
||||||
let host = TransactionHost(
|
let host = TransactionHost(
|
||||||
|
@ -147,14 +147,11 @@ proc setupCall(call: CallParams, useIntrinsic: bool): TransactionHost =
|
||||||
host.computation = newComputation(vmState, cMsg)
|
host.computation = newComputation(vmState, cMsg)
|
||||||
return host
|
return host
|
||||||
|
|
||||||
proc setupComputation*(call: CallParams): Computation =
|
|
||||||
return setupCall(call, false).computation
|
|
||||||
|
|
||||||
proc runComputation*(call: CallParams): CallResult =
|
proc runComputation*(call: CallParams): CallResult =
|
||||||
let host = setupCall(call, true)
|
let host = setupHost(call)
|
||||||
let c = host.computation
|
let c = host.computation
|
||||||
|
|
||||||
# Must come after `setupCall` for correct fork.
|
# Must come after `setupHost` for correct fork.
|
||||||
if not call.noAccessList:
|
if not call.noAccessList:
|
||||||
initialAccessListEIP2929(call)
|
initialAccessListEIP2929(call)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue