fix block 668910 problem
This commit is contained in:
parent
d2b95c8191
commit
4cc318d948
|
@ -21,7 +21,6 @@ proc contractCall*(tx: Transaction, vmState: BaseVMState, sender: EthAddress, fo
|
|||
return (tx.gasLimit - gasRemaining - gasRefund)
|
||||
else:
|
||||
if computation.tracingEnabled: computation.traceError()
|
||||
vmState.clearLogs()
|
||||
return tx.gasLimit
|
||||
|
||||
proc processTransaction*(tx: Transaction, sender: EthAddress, vmState: BaseVMState): GasInt =
|
||||
|
|
|
@ -276,6 +276,7 @@ proc addChildComputation(fork: Fork, computation: var BaseComputation, child: Ba
|
|||
computation.returnData = child.output
|
||||
for k, v in child.accountsToDelete:
|
||||
computation.accountsToDelete[k] = v
|
||||
computation.logEntries.add child.logEntries
|
||||
computation.children.add(child)
|
||||
|
||||
proc getFork*(computation: BaseComputation): Fork =
|
||||
|
@ -302,7 +303,7 @@ proc isSuicided*(c: var BaseComputation, address: EthAddress): bool =
|
|||
result = address in c.accountsToDelete
|
||||
|
||||
proc addLogEntry*(c: var BaseComputation, log: Log) {.inline.} =
|
||||
c.vmState.addLogEntry(log)
|
||||
c.logEntries.add(log)
|
||||
|
||||
# many methods are basically TODO, but they still return valid values
|
||||
# in order to test some existing code
|
||||
|
|
|
@ -163,17 +163,13 @@ proc getTracingResult*(vmState: BaseVMState): JsonNode =
|
|||
assert(vmState.tracingEnabled)
|
||||
vmState.tracer.trace
|
||||
|
||||
proc addLogEntry*(vmState: BaseVMState, log: Log) =
|
||||
vmState.logEntries.add(log)
|
||||
proc addLogs*(vmState: BaseVMState, logs: seq[Log]) =
|
||||
shallowCopy(vmState.logEntries, logs)
|
||||
|
||||
proc getAndClearLogEntries*(vmState: BaseVMState): seq[Log] =
|
||||
shallowCopy(result, vmState.logEntries)
|
||||
vmState.logEntries = @[]
|
||||
|
||||
proc clearLogs*(vmState: BaseVMState) =
|
||||
# call this when computation error
|
||||
vmState.logEntries.setLen(0)
|
||||
|
||||
proc enableTracing*(vmState: BaseVMState) =
|
||||
vmState.tracingEnabled = true
|
||||
|
||||
|
|
|
@ -82,6 +82,7 @@ proc execComputation*(computation: var BaseComputation): bool =
|
|||
|
||||
if result:
|
||||
snapshot.commit()
|
||||
computation.vmState.addLogs(computation.logEntries)
|
||||
else:
|
||||
snapshot.revert()
|
||||
|
||||
|
@ -126,7 +127,6 @@ proc applyCreateTransaction*(tx: Transaction, vmState: BaseVMState, sender: EthA
|
|||
return (gasUsed + codeCost - gasRefund)
|
||||
else:
|
||||
if c.tracingEnabled: c.traceError()
|
||||
vmState.clearLogs()
|
||||
return tx.gasLimit
|
||||
|
||||
#[
|
||||
|
|
|
@ -64,6 +64,7 @@ type
|
|||
gasCosts*: GasCosts # TODO - will be hidden at a lower layer
|
||||
opCodeExec*: OpcodeExecutor
|
||||
forkOverride*: Option[Fork]
|
||||
logEntries*: seq[Log]
|
||||
|
||||
Error* = ref object
|
||||
info*: string
|
||||
|
|
Loading…
Reference in New Issue