From 14f317a36525cef9fc5228f983218b9e1e96c379 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 13 Nov 2018 17:59:08 +0100 Subject: [PATCH] fix full storage changes --- src/app/debugger/debugger/VmDebugger.js | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/app/debugger/debugger/VmDebugger.js b/src/app/debugger/debugger/VmDebugger.js index c9e4e069bf..7bcc12d160 100644 --- a/src/app/debugger/debugger/VmDebugger.js +++ b/src/app/debugger/debugger/VmDebugger.js @@ -166,22 +166,20 @@ class VmDebuggerLogic { }) }) - self.debugger.event.register('indexChanged', this, function (index) { + self.event.register('indexChanged', this, function (index) { if (index < 0) return if (self.stepManager.currentStepIndex !== index) return if (!self.storageResolver) return - - if (index !== self.traceLength - 1) { - return self.event.trigger('traceLengthUpdate', [{}]) - } - var storageJSON = {} + + // Full storage changes are queried for each step (not only at the end of the trace as it was before) + let storageJSON = {} for (var k in self.addresses) { - var address = self.addresses[k] - var storageViewer = new StorageViewer({ stepIndex: self.stepManager.currentStepIndex, tx: self.tx, address: address }, self.storageResolver, self._traceManager) - storageViewer.storageRange(function (error, result) { + let address = self.addresses[k] + let storage = {} + self._traceManager.accumulateStorageChanges(self.stepManager.currentStepIndex, address, storage, (error, result) => { if (!error) { storageJSON[address] = result - self.event.trigger('traceLengthUpdate', [storageJSON]) + self.event.trigger('traceStorageUpdate', [storageJSON]) } }) }