simplify returnData logic

This commit is contained in:
andri lim 2020-01-30 21:34:30 +07:00 committed by zah
parent 22dff9ff88
commit 109f841a9e
2 changed files with 4 additions and 8 deletions

View File

@ -293,14 +293,9 @@ proc addChildComputation*(c, child: Computation) =
child.vmState.touchedAccounts.incl child.msg.contractAddress
if child.isError:
if child.shouldBurnGas:
c.returnData = @[]
else:
c.returnData = child.output
c.returnData = child.output
else:
if child.msg.isCreate:
c.returnData = @[]
else:
if not child.msg.isCreate:
c.returnData = child.output
child.touchedAccounts.incl child.msg.contractAddress
c.logEntries.add child.logEntries

View File

@ -561,7 +561,8 @@ proc canTransfer(c: Computation, memPos, memLen: int, value: Uint256, opCode: st
c.gasMeter.consumeGas(gasCost, reason = reason)
c.memory.extend(memPos, memLen)
c.returnData.setLen(0)
# the sender is childmsg sender, not parent msg sender
# perhaps we need to move this code somewhere else
# to avoid confusion