|
|
@ -124,23 +124,15 @@ class InternalCallTree { |
|
|
|
return functions |
|
|
|
return functions |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
extractSourceLocation (step) { |
|
|
|
async extractSourceLocation (step) { |
|
|
|
return new Promise((resolve, reject) => { |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
const address = this.traceManager.getCurrentCalledAddressAt(step) |
|
|
|
const address = this.traceManager.getCurrentCalledAddressAt(step) |
|
|
|
try { |
|
|
|
const location = await this.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts) |
|
|
|
this.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, step, this.solidityProxy.contracts).then(resolve).catch((error) => { |
|
|
|
return location |
|
|
|
return reject('InternalCallTree - Cannot retrieve sourcelocation for step ' + step + ' ' + error) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
|
|
return reject('InternalCallTree - Cannot retrieve address for step ' + step + ' ' + error) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} catch (error) { |
|
|
|
} catch (error) { |
|
|
|
return reject('InternalCallTree - Cannot retrieve address for step ' + step + ' ' + error) |
|
|
|
throw new Error('InternalCallTree - Cannot retrieve sourcelocation for step ' + step + ' ' + error) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
async function buildTree (tree, step, scopeId, isExternalCall) { |
|
|
|
async function buildTree (tree, step, scopeId, isExternalCall) { |
|
|
|