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

refactor getSourceLocationFromInstructionIndex

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