js/tracers: make calltracer report value in selfdestructs (#21549)

This commit is contained in:
Julian Koh 2020-09-14 13:57:28 +01:00 committed by GitHub
parent 4eb9296910
commit 71c37d82ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -61,7 +61,14 @@
if (this.callstack[left-1].calls === undefined) { if (this.callstack[left-1].calls === undefined) {
this.callstack[left-1].calls = []; 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 return
} }
// If a new method invocation is being done, add to the call stack // If a new method invocation is being done, add to the call stack