Commit e13c8fe7 authored by yann300's avatar yann300 Committed by GitHub

Merge pull request #195 from ethereum/fixlocals

Various fixes
parents 65828520 9b86659f
...@@ -279,6 +279,7 @@ function typeClass (fullType) { ...@@ -279,6 +279,7 @@ function typeClass (fullType) {
*/ */
function parseType (type, stateDefinitions, contractName, location) { function parseType (type, stateDefinitions, contractName, location) {
var decodeInfos = { var decodeInfos = {
'contract': address,
'address': address, 'address': address,
'array': array, 'array': array,
'bool': bool, 'bool': bool,
......
...@@ -44,11 +44,13 @@ SolidityState.prototype.init = function () { ...@@ -44,11 +44,13 @@ SolidityState.prototype.init = function () {
self.traceManager.getStorageAt(index, this.parent.tx, function (error, storage) { self.traceManager.getStorageAt(index, this.parent.tx, function (error, storage) {
if (error) { if (error) {
self.basicPanel.update({ info: error }) self.basicPanel.update({})
console.log(error)
} else { } else {
self.solidityProxy.extractStateVariablesAt(index, function (error, stateVars) { self.solidityProxy.extractStateVariablesAt(index, function (error, stateVars) {
if (error) { if (error) {
self.basicPanel.update({ info: error }) self.basicPanel.update({})
console.log(error)
} else { } else {
self.basicPanel.update(stateDecoder.decodeState(stateVars, storage)) self.basicPanel.update(stateDecoder.decodeState(stateVars, storage))
} }
......
...@@ -4,6 +4,7 @@ var AstWalker = require('./astWalker') ...@@ -4,6 +4,7 @@ var AstWalker = require('./astWalker')
var EventManager = require('../lib/eventManager') var EventManager = require('../lib/eventManager')
var decodeInfo = require('../solidity/decodeInfo') var decodeInfo = require('../solidity/decodeInfo')
var util = require('../helpers/util') var util = require('../helpers/util')
var traceHelper = require('../helpers/traceHelper')
/** /**
* Tree representing internal jump into function. * Tree representing internal jump into function.
...@@ -73,7 +74,7 @@ class InternalCallTree { ...@@ -73,7 +74,7 @@ class InternalCallTree {
var scopeId = util.findLowerBoundValue(vmtraceIndex, scopes) var scopeId = util.findLowerBoundValue(vmtraceIndex, scopes)
scopeId = this.scopeStarts[scopeId] scopeId = this.scopeStarts[scopeId]
var scope = this.scopes[scopeId] var scope = this.scopes[scopeId]
while (scope.lastStep && scope.lastStep < vmtraceIndex) { while (scope.lastStep && scope.lastStep < vmtraceIndex && scope.firstStep > 0) {
var matched = scopeId.match(/(.\d|\d)$/) var matched = scopeId.match(/(.\d|\d)$/)
scopeId = scopeId.replace(matched[1], '') scopeId = scopeId.replace(matched[1], '')
scope = this.scopes[scopeId] scope = this.scopes[scopeId]
......
...@@ -123,7 +123,7 @@ web3VmProvider.prototype.pushTrace = function (self, data) { ...@@ -123,7 +123,7 @@ web3VmProvider.prototype.pushTrace = function (self, data) {
this.processingAddress = uiutil.normalizeHex(step.stack[step.stack.length - 2]) this.processingAddress = uiutil.normalizeHex(step.stack[step.stack.length - 2])
if (!self.storageCache[self.processingHash][this.processingAddress]) { if (!self.storageCache[self.processingHash][this.processingAddress]) {
self.vm.stateManager.dumpStorage(this.processingAddress, function (storage) { self.vm.stateManager.dumpStorage(this.processingAddress, function (storage) {
self.storageCache[self.processingHash][this.processingAddress] = storage self.storageCache[self.processingHash][self.processingAddress] = storage
}) })
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment