Commit e40d76ef authored by yann300's avatar yann300

do not reextract state vars if context is the same

parent e3a8710d
...@@ -18,6 +18,7 @@ function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) { ...@@ -18,6 +18,7 @@ function SolidityState (_parent, _traceManager, _codeManager, _solidityProxy) {
}) })
this.init() this.init()
this.view this.view
this.stateVariablesByAddresses = {}
} }
SolidityState.prototype.render = function () { SolidityState.prototype.render = function () {
...@@ -54,26 +55,35 @@ SolidityState.prototype.init = function () { ...@@ -54,26 +55,35 @@ SolidityState.prototype.init = function () {
self.basicPanel.update({}) self.basicPanel.update({})
console.log(error) console.log(error)
} else { } else {
self.solidityProxy.extractStateVariablesAt(index, function (error, stateVars) { if (self.stateVariablesByAddresses[address]) {
if (error) { extractStateVariables(self, self.stateVariablesByAddresses[address], address)
self.basicPanel.update({}) } else {
console.log(error) self.solidityProxy.extractStateVariablesAt(index, function (error, stateVars) {
} else { if (error) {
var storageViewer = new StorageViewer({ self.basicPanel.update({})
stepIndex: self.parent.currentStepIndex, console.log(error)
tx: self.parent.tx, } else {
address: address self.stateVariablesByAddresses[address] = stateVars
}, self.storageResolver, self.traceManager) extractStateVariables(self, stateVars)
stateDecoder.decodeState(stateVars, storageViewer).then((result) => { }
if (!result.error) { })
self.basicPanel.update(result) }
}
})
}
})
} }
}) })
}) })
} }
function extractStateVariables (self, stateVars, address) {
var storageViewer = new StorageViewer({
stepIndex: self.parent.currentStepIndex,
tx: self.parent.tx,
address: address
}, self.storageResolver, self.traceManager)
stateDecoder.decodeState(stateVars, storageViewer).then((result) => {
if (!result.error) {
self.basicPanel.update(result)
}
})
}
module.exports = SolidityState module.exports = SolidityState
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