Commit 245c48d2 authored by Iuri Matias's avatar Iuri Matias

refactor getSourceLocationFromInstructionIndex

parent d19e441f
...@@ -22,12 +22,9 @@ function SourceLocationTracker (_codeManager) { ...@@ -22,12 +22,9 @@ function SourceLocationTracker (_codeManager) {
* @param {Object} contractDetails - AST of compiled contracts * @param {Object} contractDetails - AST of compiled contracts
* @param {Function} cb - callback function * @param {Function} cb - callback function
*/ */
SourceLocationTracker.prototype.getSourceLocationFromInstructionIndex = function (address, index, contracts) { SourceLocationTracker.prototype.getSourceLocationFromInstructionIndex = async function (address, index, contracts) {
return new Promise((resolve, reject) => { const sourceMap = await extractSourceMap(this, this.codeManager, address, contracts)
extractSourceMap(this, this.codeManager, address, contracts).then((sourceMap) => { return this.sourceMappingDecoder.atIndex(index, sourceMap)
resolve(this.sourceMappingDecoder.atIndex(index, sourceMap))
}).catch(reject)
})
} }
/** /**
......
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