From bd1669cc52035d48463900f95d467e83695576f1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 19 Dec 2017 14:14:28 +0100 Subject: [PATCH 1/2] check if vm trace opcodes is populated --- remix-lib/src/web3Provider/web3VmProvider.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/remix-lib/src/web3Provider/web3VmProvider.js b/remix-lib/src/web3Provider/web3VmProvider.js index 3d63446e92..c0e70498a5 100644 --- a/remix-lib/src/web3Provider/web3VmProvider.js +++ b/remix-lib/src/web3Provider/web3VmProvider.js @@ -97,7 +97,9 @@ web3VmProvider.prototype.txWillProcess = function (self, data) { web3VmProvider.prototype.txProcessed = function (self, data) { var lastOp = self.vmTraces[self.processingHash].structLogs[self.processingIndex - 1] - lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' + if (lastOp) { + lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' + } self.vmTraces[self.processingHash].gas = '0x' + data.gasUsed.toString(16) var logs = [] From c5c4fa603d6eb4f7e2da808de4e4c2f911f9aeb2 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 19 Dec 2017 14:50:35 +0100 Subject: [PATCH 2/2] add SELFDESTRUCT --- remix-lib/src/web3Provider/web3VmProvider.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/remix-lib/src/web3Provider/web3VmProvider.js b/remix-lib/src/web3Provider/web3VmProvider.js index c0e70498a5..6a064bcdf2 100644 --- a/remix-lib/src/web3Provider/web3VmProvider.js +++ b/remix-lib/src/web3Provider/web3VmProvider.js @@ -98,7 +98,7 @@ web3VmProvider.prototype.txWillProcess = function (self, data) { web3VmProvider.prototype.txProcessed = function (self, data) { var lastOp = self.vmTraces[self.processingHash].structLogs[self.processingIndex - 1] if (lastOp) { - lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' + lastOp.error = lastOp.op !== 'RETURN' && lastOp.op !== 'STOP' && lastOp.op !== 'SELFDESTRUCT' } self.vmTraces[self.processingHash].gas = '0x' + data.gasUsed.toString(16)