mirror of
https://github.com/status-im/nimbus-eth1.git
synced 2025-01-26 20:19:31 +00:00
fixes #244
This commit is contained in:
parent
3bbe7fede3
commit
79630611c0
@ -300,3 +300,7 @@ proc executeOpcodes(computation: BaseComputation) =
|
||||
let msg = getCurrentExceptionMsg()
|
||||
computation.setError(&"Opcode Dispatch Error msg={msg}, depth={computation.msg.depth}", true)
|
||||
computation.nextProc()
|
||||
|
||||
if computation.isError():
|
||||
if computation.tracingEnabled: computation.traceError()
|
||||
debug "executeOpcodes error", msg=computation.error.info
|
||||
|
@ -120,9 +120,10 @@ proc traceError*(tracer: var TransactionTracer, c: BaseComputation) =
|
||||
j["error"] = %(c.error.info)
|
||||
trace "Error", json = j.pretty()
|
||||
|
||||
# TODO: figure out how to get gasCost
|
||||
# when contract execution failed before traceOpCodeEnded called
|
||||
# because exception raised
|
||||
#j["gasCost"] = %
|
||||
# even though the gasCost is incorrect,
|
||||
# we have something to display,
|
||||
# it is an error anyway
|
||||
let gasRemaining = j["gas"].getInt()
|
||||
j["gasCost"] = %(gasRemaining - c.gasMeter.gasRemaining)
|
||||
|
||||
tracer.trace["failed"] = %true
|
||||
|
@ -74,7 +74,7 @@ proc execComputation*(computation: var BaseComputation): bool =
|
||||
for deletedAccount in computation.accountsForDeletion:
|
||||
db.deleteAccount deletedAccount
|
||||
inc suicidedCount
|
||||
|
||||
|
||||
# FIXME: hook this into actual RefundSelfDestruct
|
||||
const RefundSelfDestruct = 24_000
|
||||
computation.gasMeter.refundGas(RefundSelfDestruct * suicidedCount)
|
||||
@ -82,8 +82,6 @@ proc execComputation*(computation: var BaseComputation): bool =
|
||||
result = computation.isSuccess
|
||||
if result:
|
||||
computation.vmState.addLogs(computation.logEntries)
|
||||
else:
|
||||
if computation.tracingEnabled: computation.traceError()
|
||||
|
||||
proc refundGas*(computation: BaseComputation, tx: Transaction, sender: EthAddress): GasInt =
|
||||
let
|
||||
|
Loading…
x
Reference in New Issue
Block a user