Commit c88caade authored by yann300's avatar yann300

use extractStatesDefinitions

parent 8551a651
...@@ -74,11 +74,10 @@ function buildTree (tree, step, scopeId, trace) { ...@@ -74,11 +74,10 @@ function buildTree (tree, step, scopeId, trace) {
if (!error) { if (!error) {
tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached
if (!error) { if (!error) {
tree.solidityProxy.extractStateVariablesAt(step, (error, stateVars) => { // cached var states = tree.solidityProxy.extractStatesDefinitions()
if (!error) {
tree.scopes[scopeId].locals[variableDeclaration.attributes.name] = { tree.scopes[scopeId].locals[variableDeclaration.attributes.name] = {
name: variableDeclaration.attributes.name, name: variableDeclaration.attributes.name,
type: decodeInfo.parseType(variableDeclaration.attributes.type, contractName, stateVars), type: decodeInfo.parseType(variableDeclaration.attributes.type, states, contractName),
stackHeight: stack.length stackHeight: stack.length
} }
} }
...@@ -86,8 +85,6 @@ function buildTree (tree, step, scopeId, trace) { ...@@ -86,8 +85,6 @@ function buildTree (tree, step, scopeId, trace) {
} }
}) })
} }
})
}
} }
step++ step++
...@@ -116,15 +113,7 @@ function resolveVariableDeclaration (tree, step, sourceLocation) { ...@@ -116,15 +113,7 @@ function resolveVariableDeclaration (tree, step, sourceLocation) {
tree.variableDeclarationByFile[sourceLocation.file] = extractVariableDeclarations(tree.solidityProxy.ast(sourceLocation), tree.astWalker) tree.variableDeclarationByFile[sourceLocation.file] = extractVariableDeclarations(tree.solidityProxy.ast(sourceLocation), tree.astWalker)
} }
var variableDeclarations = tree.variableDeclarationByFile[sourceLocation.file] var variableDeclarations = tree.variableDeclarationByFile[sourceLocation.file]
var ret = null return variableDeclarations[sourceLocation.start + ':' + sourceLocation.length + ':' + sourceLocation.file]
tree.solidityProxy.extractStateVariablesAt(step, (error, stateVars) => { // cached
if (error) {
console.log(error)
} else {
ret = variableDeclarations[sourceLocation.start + ':' + sourceLocation.length + ':' + sourceLocation.file]
}
})
return ret
} }
function extractVariableDeclarations (ast, astWalker) { function extractVariableDeclarations (ast, astWalker) {
......
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