retrieve storage

pull/7/head
yann300 8 years ago
parent db50414691
commit 01acbda319
  1. 4
      src/solidity/localDecoder.js
  2. 8
      src/ui/SolidityLocals.js

@ -1,6 +1,6 @@
'use strict'
function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory, storage) {
var scope = internalTreeCall.findScope(vmtraceIndex)
if (!scope) {
var error = { 'message': 'Can\'t display locals. reason: compilation result might not have been provided' }
@ -11,7 +11,7 @@ function solidityLocals (vmtraceIndex, internalTreeCall, stack, memory) {
for (var local in scope.locals) {
let variable = scope.locals[local]
if (variable.stackDepth < stack.length) {
locals[variable.name] = variable.type.decodeFromStack(variable.stackDepth, stack, memory)
locals[variable.name] = variable.type.decodeFromStack(variable.stackDepth, stack, memory, storage)
}
}
return locals

@ -47,8 +47,12 @@ class SolidityLocals {
var stack = result[0].value
var memory = result[1].value
try {
var locals = localDecoder.solidityLocals(index, this.internalTreeCall, stack, memory)
this.basicPanel.update(locals)
this.traceManager.getStorageAt(index, this.parent.tx, (error, storage) => {
if (!error) {
var locals = localDecoder.solidityLocals(index, this.internalTreeCall, stack, memory, storage)
this.basicPanel.update(locals)
}
})
} catch (e) {
warningDiv.innerHTML = e.message
}

Loading…
Cancel
Save