diff --git a/libs/remix-debug/src/storage/storageResolver.js b/libs/remix-debug/src/storage/storageResolver.js index 9ee951f766..1cf345ba5c 100644 --- a/libs/remix-debug/src/storage/storageResolver.js +++ b/libs/remix-debug/src/storage/storageResolver.js @@ -61,10 +61,12 @@ class StorageResolver { * @param {String} - address - lookup address * @param {Function} - callback - {key, hashedKey, value} - */ - storageSlot (slot, tx, stepIndex, address, callback) { - this.storageRangeInternal(this, slot, tx, stepIndex, address).then((storage) => { - callback(null, storage[slot] !== undefined ? storage[slot] : null) - }).catch(callback) + storageSlot (slot, tx, stepIndex, address) { + return new Promise((resolve, reject) => { + this.storageRangeInternal(this, slot, tx, stepIndex, address).then((storage) => { + resolve(storage[slot] !== undefined ? storage[slot] : null) + }).catch(reject) + }) } /** diff --git a/libs/remix-debug/src/storage/storageViewer.js b/libs/remix-debug/src/storage/storageViewer.js index 59325f887f..3da4d6ca06 100644 --- a/libs/remix-debug/src/storage/storageViewer.js +++ b/libs/remix-debug/src/storage/storageViewer.js @@ -46,13 +46,9 @@ class StorageViewer { if (this.storageChanges[hashed]) { return callback(null, this.storageChanges[hashed]) } - this.storageResolver.storageSlot(hashed, this.context.tx, this.context.stepIndex, this.context.address, (error, storage) => { - if (error) { - callback(error) - } else { - callback(null, storage) - } - }) + this.storageResolver.storageSlot(hashed, this.context.tx, this.context.stepIndex, this.context.address).then((storage) => { + callback(null, storage) + }).catch(callback) } /**