From 71c37d82adaa2b69ea98ce0c5505489d6b711c1e Mon Sep 17 00:00:00 2001 From: Julian Koh Date: Mon, 14 Sep 2020 13:57:28 +0100 Subject: [PATCH] js/tracers: make calltracer report value in selfdestructs (#21549) --- eth/tracers/internal/tracers/call_tracer.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/eth/tracers/internal/tracers/call_tracer.js b/eth/tracers/internal/tracers/call_tracer.js index 352c309b49..3ca7377738 100644 --- a/eth/tracers/internal/tracers/call_tracer.js +++ b/eth/tracers/internal/tracers/call_tracer.js @@ -61,7 +61,14 @@ if (this.callstack[left-1].calls === undefined) { this.callstack[left-1].calls = []; } - this.callstack[left-1].calls.push({type: op}); + this.callstack[left-1].calls.push({ + type: op, + from: toHex(log.contract.getAddress()), + to: toHex(toAddress(log.stack.peek(0).toString(16))), + gasIn: log.getGas(), + gasCost: log.getCost(), + value: '0x' + db.getBalance(log.contract.getAddress()).toString(16) + }); return } // If a new method invocation is being done, add to the call stack