|
|
|
@ -134,25 +134,25 @@ export class CodeManager { |
|
|
|
|
return findNodeAtInstructionIndex('FunctionDefinition', instIndex, sourceMap, ast) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private retrieveCodeAndTrigger (codeMananger, address, stepIndex, tx) { |
|
|
|
|
codeMananger.getCode(address).then((result) => { |
|
|
|
|
this.retrieveIndexAndTrigger(codeMananger, address, stepIndex, result.instructions) |
|
|
|
|
private retrieveCodeAndTrigger (codeManager, address, stepIndex, tx) { |
|
|
|
|
codeManager.getCode(address).then((result) => { |
|
|
|
|
this.retrieveIndexAndTrigger(codeManager, address, stepIndex, result.instructions) |
|
|
|
|
}).catch((error) => { |
|
|
|
|
return console.log(error) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private async retrieveIndexAndTrigger (codeMananger, address, step, code) { |
|
|
|
|
private async retrieveIndexAndTrigger (codeManager, address, step, code) { |
|
|
|
|
let result |
|
|
|
|
const next = [] |
|
|
|
|
const returnInstructionIndexes = [] |
|
|
|
|
const outOfGasInstructionIndexes = [] |
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
result = codeMananger.getInstructionIndex(address, step) |
|
|
|
|
result = codeManager.getInstructionIndex(address, step) |
|
|
|
|
for (let i = 1; i < 6; i++) { |
|
|
|
|
if (this.traceManager.inRange(step + i)) { |
|
|
|
|
next.push(codeMananger.getInstructionIndex(address, step + i)) |
|
|
|
|
next.push(codeManager.getInstructionIndex(address, step + i)) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -177,7 +177,7 @@ export class CodeManager { |
|
|
|
|
return console.log(error) |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
codeMananger.event.trigger('changed', [code, address, result, next, returnInstructionIndexes, outOfGasInstructionIndexes]) |
|
|
|
|
codeManager.event.trigger('changed', [code, address, result, next, returnInstructionIndexes, outOfGasInstructionIndexes]) |
|
|
|
|
} catch (e) { |
|
|
|
|
console.log('dispatching event failed', e) |
|
|
|
|
} |
|
|
|
|