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:
Jamie Lokier 2021-05-17 18:01:32 +01:00
parent 8b4f5a1103
commit beb750b8df
No known key found for this signature in database
GPG Key ID: CBC25C68435C30A2
1 changed files with 4 additions and 7 deletions

View File

@ -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)