mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-26 12:08:59 +00:00
Fixtures: Change fixture tests to use shared setupComputation
Change fixtures tests to use shared `setupComputation` instead of their own slightly different variant. Signed-off-by: Jamie Lokier <jamie@shareable.org>
This commit is contained in:
parent
a5385e5344
commit
4e51a5bb35
@ -320,24 +320,18 @@ proc asmCallEvm*(blockNumber: Uint256, chainDB: BaseChainDB, code, data: seq[byt
|
|||||||
|
|
||||||
proc fixtureSetupComputation(vmState: BaseVMState, call: RpcCallData,
|
proc fixtureSetupComputation(vmState: BaseVMState, call: RpcCallData,
|
||||||
origin: EthAddress, forkOverride = none(Fork)): Computation =
|
origin: EthAddress, forkOverride = none(Fork)): Computation =
|
||||||
vmState.setupTxContext(
|
return setupComputation(CallParams(
|
||||||
origin = origin, # Differs from `rpcSetupComputation`
|
vmState: vmState,
|
||||||
gasPrice = call.gasPrice,
|
forkOverride: forkOverride,
|
||||||
forkOverride = forkOverride,
|
origin: some(origin),
|
||||||
)
|
gasPrice: call.gasPrice,
|
||||||
|
gasLimit: call.gas, # Differs from `rpcSetupComputation`
|
||||||
var msg = Message(
|
sender: call.source,
|
||||||
kind: if call.contractCreation: evmcCreate else: evmcCall,
|
to: call.to,
|
||||||
depth: 0,
|
isCreate: call.contractCreation,
|
||||||
gas: call.gas, # Differs from `rpcSetupComputation`
|
value: call.value,
|
||||||
sender: call.source,
|
input: call.data
|
||||||
contractAddress: call.to,
|
))
|
||||||
codeAddress: call.to,
|
|
||||||
value: call.value,
|
|
||||||
data: call.data
|
|
||||||
)
|
|
||||||
|
|
||||||
return newComputation(vmState, msg)
|
|
||||||
|
|
||||||
type
|
type
|
||||||
FixtureResult* = object
|
FixtureResult* = object
|
||||||
|
Loading…
x
Reference in New Issue
Block a user