diff --git a/nimbus/vm/computation.nim b/nimbus/vm/computation.nim index ee7fa062f..87d4f870f 100644 --- a/nimbus/vm/computation.nim +++ b/nimbus/vm/computation.nim @@ -337,26 +337,10 @@ proc execSelfDestruct*(c: Computation, beneficiary: EthAddress) = proc addLogEntry*(c: Computation, log: Log) {.inline.} = c.logEntries.add(log) -proc getSuicides*(c: Computation): HashSet[EthAddress] = - if c.isSuccess: - result = c.suicides - proc getGasRefund*(c: Computation): GasInt = if c.isSuccess: result = c.gasMeter.gasRefunded -proc getGasUsed*(c: Computation): GasInt = - if c.shouldBurnGas: - result = c.msg.gas - else: - result = max(0, c.msg.gas - c.gasMeter.gasRemaining) - -proc getGasRemaining*(c: Computation): GasInt = - if c.shouldBurnGas: - result = 0 - else: - result = c.gasMeter.gasRemaining - proc refundSelfDestruct*(c: Computation) = let cost = gasFees[c.fork][RefundSelfDestruct] c.gasMeter.refundGas(cost * c.suicides.len) diff --git a/nimbus/vm_state.nim b/nimbus/vm_state.nim index f11258ac7..0a0cd1a4f 100644 --- a/nimbus/vm_state.nim +++ b/nimbus/vm_state.nim @@ -106,9 +106,6 @@ proc getTracingResult*(vmState: BaseVMState): JsonNode = doAssert(vmState.tracingEnabled) vmState.tracer.trace -proc addLogs*(vmState: BaseVMState, logs: seq[Log]) = - shallowCopy(vmState.logEntries, logs) - proc getAndClearLogEntries*(vmState: BaseVMState): seq[Log] = shallowCopy(result, vmState.logEntries) vmState.logEntries = @[] diff --git a/nimbus/vm_state_transactions.nim b/nimbus/vm_state_transactions.nim index 14cf84ed0..32bded340 100644 --- a/nimbus/vm_state_transactions.nim +++ b/nimbus/vm_state_transactions.nim @@ -82,8 +82,8 @@ proc execComputation*(c: Computation) = if c.isSuccess: c.refundSelfDestruct() - c.vmState.suicides = c.getSuicides() - c.vmState.addLogs(c.logEntries) + shallowCopy(c.vmState.suicides, c.suicides) + shallowCopy(c.vmState.logEntries, c.logEntries) c.vmstate.status = c.isSuccess