From 2643c0d4c639e867d6a66f3c2004ce5812c08638 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 31 Jul 2017 18:37:32 +0200 Subject: [PATCH] add logs to transaction receipt --- src/web3Provider/web3VmProvider.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/web3Provider/web3VmProvider.js b/src/web3Provider/web3VmProvider.js index cb22bbd806..62f60a55a2 100644 --- a/src/web3Provider/web3VmProvider.js +++ b/src/web3Provider/web3VmProvider.js @@ -88,6 +88,18 @@ web3VmProvider.prototype.txProcessed = function (self, data) { var lastOp = self.vmTraces[self.processingHash].structLogs[self.processingIndex - 1] lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' self.vmTraces[self.processingHash].gas = '0x' + data.gasUsed.toString(16) + + var logs = [] + for (var l in data.vm.logs) { + var log = data.vm.logs[l] + logs.push({ + data: log[2].toString('hex'), + topics: [log[1][0].toString('hex')], + rawVMResponse: log + }) + } + self.txsReceipt[self.processingHash].logs = logs + if (data.createdAddress) { var address = util.hexConvert(data.createdAddress) self.vmTraces[self.processingHash].return = address