mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-12 21:34:33 +00:00
EVM cleanup
This commit is contained in:
parent
26620eb672
commit
7d113b839f
@ -246,10 +246,6 @@ template gasCosts*(c: Computation): untyped =
|
|||||||
template fork*(c: Computation): untyped =
|
template fork*(c: Computation): untyped =
|
||||||
c.vmState.fork
|
c.vmState.fork
|
||||||
|
|
||||||
proc isOriginComputation*(c: Computation): bool =
|
|
||||||
# Is this computation the computation initiated by a transaction
|
|
||||||
c.msg.sender == c.vmState.txOrigin
|
|
||||||
|
|
||||||
template isSuccess*(c: Computation): bool =
|
template isSuccess*(c: Computation): bool =
|
||||||
c.error.isNil
|
c.error.isNil
|
||||||
|
|
||||||
|
@ -89,6 +89,12 @@ else:
|
|||||||
c.vmState.mutateStateDB:
|
c.vmState.mutateStateDB:
|
||||||
db.setStorage(c.msg.contractAddress, slot, newValue)
|
db.setStorage(c.msg.contractAddress, slot, newValue)
|
||||||
|
|
||||||
|
template sstoreEvmcOrSstore(cpt, slot, newValue: untyped) =
|
||||||
|
when evmc_enabled:
|
||||||
|
sstoreEvmc(cpt, slot, newValue, 0.GasInt)
|
||||||
|
else:
|
||||||
|
sstoreImpl(cpt, slot, newValue)
|
||||||
|
|
||||||
template sstoreEvmcOrNetGasMetering(cpt, slot, newValue: untyped, coldAccess = 0.GasInt) =
|
template sstoreEvmcOrNetGasMetering(cpt, slot, newValue: untyped, coldAccess = 0.GasInt) =
|
||||||
when evmc_enabled:
|
when evmc_enabled:
|
||||||
sstoreEvmc(cpt, slot, newValue, coldAccess)
|
sstoreEvmc(cpt, slot, newValue, coldAccess)
|
||||||
@ -191,7 +197,7 @@ const
|
|||||||
|
|
||||||
checkInStaticContext(cpt)
|
checkInStaticContext(cpt)
|
||||||
cpt.asyncChainTo(ifNecessaryGetSlot(cpt.vmState, cpt.msg.contractAddress, slot)):
|
cpt.asyncChainTo(ifNecessaryGetSlot(cpt.vmState, cpt.msg.contractAddress, slot)):
|
||||||
sstoreEvmcOrNetGasMetering(cpt, slot, newValue)
|
sstoreEvmcOrSstore(cpt, slot, newValue)
|
||||||
|
|
||||||
|
|
||||||
sstoreEIP1283Op: Vm2OpFn = proc (k: var Vm2Ctx) =
|
sstoreEIP1283Op: Vm2OpFn = proc (k: var Vm2Ctx) =
|
||||||
|
@ -39,7 +39,6 @@ export
|
|||||||
vmc.getStorage,
|
vmc.getStorage,
|
||||||
vmc.getTimestamp,
|
vmc.getTimestamp,
|
||||||
vmc.isError,
|
vmc.isError,
|
||||||
vmc.isOriginComputation,
|
|
||||||
vmc.isSuccess,
|
vmc.isSuccess,
|
||||||
vmc.merge,
|
vmc.merge,
|
||||||
vmc.newComputation,
|
vmc.newComputation,
|
||||||
|
@ -92,7 +92,6 @@ export
|
|||||||
bChp.getStorage,
|
bChp.getStorage,
|
||||||
bChp.getTimestamp,
|
bChp.getTimestamp,
|
||||||
bChp.isError,
|
bChp.isError,
|
||||||
bChp.isOriginComputation,
|
|
||||||
bChp.isSuccess,
|
bChp.isSuccess,
|
||||||
bChp.merge,
|
bChp.merge,
|
||||||
bChp.newComputation,
|
bChp.newComputation,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user