simplify returnData logic
This commit is contained in:
parent
22dff9ff88
commit
109f841a9e
|
@ -293,14 +293,9 @@ proc addChildComputation*(c, child: Computation) =
|
||||||
child.vmState.touchedAccounts.incl child.msg.contractAddress
|
child.vmState.touchedAccounts.incl child.msg.contractAddress
|
||||||
|
|
||||||
if child.isError:
|
if child.isError:
|
||||||
if child.shouldBurnGas:
|
c.returnData = child.output
|
||||||
c.returnData = @[]
|
|
||||||
else:
|
|
||||||
c.returnData = child.output
|
|
||||||
else:
|
else:
|
||||||
if child.msg.isCreate:
|
if not child.msg.isCreate:
|
||||||
c.returnData = @[]
|
|
||||||
else:
|
|
||||||
c.returnData = child.output
|
c.returnData = child.output
|
||||||
child.touchedAccounts.incl child.msg.contractAddress
|
child.touchedAccounts.incl child.msg.contractAddress
|
||||||
c.logEntries.add child.logEntries
|
c.logEntries.add child.logEntries
|
||||||
|
|
|
@ -561,7 +561,8 @@ proc canTransfer(c: Computation, memPos, memLen: int, value: Uint256, opCode: st
|
||||||
|
|
||||||
c.gasMeter.consumeGas(gasCost, reason = reason)
|
c.gasMeter.consumeGas(gasCost, reason = reason)
|
||||||
c.memory.extend(memPos, memLen)
|
c.memory.extend(memPos, memLen)
|
||||||
|
c.returnData.setLen(0)
|
||||||
|
|
||||||
# the sender is childmsg sender, not parent msg sender
|
# the sender is childmsg sender, not parent msg sender
|
||||||
# perhaps we need to move this code somewhere else
|
# perhaps we need to move this code somewhere else
|
||||||
# to avoid confusion
|
# to avoid confusion
|
||||||
|
|
Loading…
Reference in New Issue