diff --git a/libs/remix-debug/src/Ethdebugger.js b/libs/remix-debug/src/Ethdebugger.js index a559ef5ccc..612e6ffabf 100644 --- a/libs/remix-debug/src/Ethdebugger.js +++ b/libs/remix-debug/src/Ethdebugger.js @@ -75,20 +75,18 @@ Ethdebugger.prototype.extractLocalsAt = function (step) { return this.callTree.findScope(step) } -Ethdebugger.prototype.decodeLocalsAt = function (step, sourceLocation, callback) { +Ethdebugger.prototype.decodeLocalsAt = async function (step, sourceLocation, callback) { try { const stack = this.traceManager.getStackAt(step) const memory = this.traceManager.getMemoryAt(step) const address = this.traceManager.getCurrentCalledAddressAt(step) try { const storageViewer = new StorageViewer({ stepIndex: step, tx: this.tx, address: address }, this.storageResolver, this.traceManager) - localDecoder.solidityLocals(step, this.callTree, stack, memory, storageViewer, sourceLocation).then((locals) => { - if (!locals.error) { - callback(null, locals) - } else { - callback(locals.error) - } - }) + const locals = await localDecoder.solidityLocals(step, this.callTree, stack, memory, storageViewer, sourceLocation) + if (locals.error) { + return callback(locals.error) + } + return callback(null, locals) } catch (e) { callback(e.message) }