From 63a8d24b5e8dbf2725029e7e001c4adeb75964eb Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Jun 2021 11:34:55 +0200 Subject: [PATCH] make async --- libs/remix-debug/src/debugger/VmDebugger.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libs/remix-debug/src/debugger/VmDebugger.ts b/libs/remix-debug/src/debugger/VmDebugger.ts index 621e3d3bb1..2a90d0ed2c 100644 --- a/libs/remix-debug/src/debugger/VmDebugger.ts +++ b/libs/remix-debug/src/debugger/VmDebugger.ts @@ -189,7 +189,7 @@ export class VmDebuggerLogic { }) }) - this.debugger.event.register('indexChanged', this, (index) => { + this.debugger.event.register('indexChanged', this, async (index) => { if (index < 0) return if (this.stepManager.currentStepIndex !== index) return if (!this.storageResolver) return @@ -201,11 +201,13 @@ export class VmDebuggerLogic { for (var k in this.addresses) { var address = this.addresses[k] var storageViewer = new StorageViewer({ stepIndex: this.stepManager.currentStepIndex, tx: this.tx, address: address }, this.storageResolver, this._traceManager) - storageViewer.storageRange().then((result) => { - storageJSON[address] = result - this.event.trigger('traceStorageUpdate', [storageJSON]) - }) + try { + storageJSON[address] = await storageViewer.storageRange() + } catch (e) { + console.error(e) + } } + this.event.trigger('traceStorageUpdate', [storageJSON]) }) }