Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #1466 from ethereum/fixInputParam
Browse files Browse the repository at this point in the history
Better extraction of input/outputs params
  • Loading branch information
yann300 authored Apr 28, 2020
2 parents d833c97 + 4a0a8d8 commit 8d0ef78
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions remix-debug/src/solidity-decoder/internalCallTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -227,10 +227,23 @@ function includeVariableDeclaration (tree, step, sourceLocation, scopeId, newLoc
tree.traceManager.getStackAt(step, (error, stack) => {
if (!error) {
var states = tree.solidityProxy.extractStatesDefinitions()
// input params
addParams(functionDefinition.children[0], tree, scopeId, states, contractName, previousSourceLocation, stack.length, functionDefinition.children[0].children.length, -1)
// output params
addParams(functionDefinition.children[1], tree, scopeId, states, contractName, previousSourceLocation, stack.length, 0, 1)
if (functionDefinition.children && functionDefinition.children.length) {
let inputs
let outputs
for (const element of functionDefinition.children) {
if (element.name === 'ParameterList') {
if (!inputs) inputs = element
else {
outputs = element
break
}
}
}
// input params
if (inputs) addParams(inputs, tree, scopeId, states, contractName, previousSourceLocation, stack.length, inputs.children.length, -1)
// output params
if (outputs) addParams(outputs, tree, scopeId, states, contractName, previousSourceLocation, stack.length, 0, 1)
}
}
})
}
Expand Down

0 comments on commit 8d0ef78

Please sign in to comment.