move storage changes to vm debugger logic

pull/3094/head
Iuri Matias 6 years ago committed by yann300
parent aff5d67dbf
commit a5e9464b72
  1. 28
      src/app/debugger/debuggerUI/VmDebugger.js

@ -52,6 +52,7 @@ class VmDebuggerLogic {
this.listenToEvents() this.listenToEvents()
this.listenToCodeManagerEvents() this.listenToCodeManagerEvents()
this.listenToTraceManagerEvents() this.listenToTraceManagerEvents()
this.listenToFullStorageChanges()
} }
listenToEvents () { listenToEvents () {
@ -160,6 +161,21 @@ class VmDebuggerLogic {
}) })
} }
listenToFullStorageChanges () {
const self = this
self._parentUI.debugger.event.register('newTraceLoaded', function (length) {
self._traceManager.getAddresses(function (error, addresses) {
if (error) return
self.event.trigger('traceAddressesUpdate', [addresses])
})
self._traceManager.getLength(function (error, length) {
if (error) return
self.event.trigger('traceLengthUpdate', [length])
})
})
}
} }
function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _callTree) { function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _callTree) {
@ -248,20 +264,14 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca
this.fullStoragesChangesPanel = new FullStoragesChangesPanel(_parentUI, _traceManager) this.fullStoragesChangesPanel = new FullStoragesChangesPanel(_parentUI, _traceManager)
this.addresses = [] this.addresses = []
_parentUI.debugger.event.register('newTraceLoaded', this, function (length) {
self.panels = [] this.vmDebuggerLogic.event.register('traceAddressesUpdate', function (addresses) {
_traceManager.getAddresses(function (error, addresses) {
if (!error) {
self.addresses = addresses self.addresses = addresses
self.fullStoragesChangesPanel.update({}) self.fullStoragesChangesPanel.update({})
}
}) })
_traceManager.getLength(function (error, length) { this.vmDebuggerLogic.event.register('traceLengthUpdate', function (length) {
if (!error) {
self.traceLength = length self.traceLength = length
}
})
}) })
_parentUI.debugger.event.register('indexChanged', this, function (index) { _parentUI.debugger.event.register('indexChanged', this, function (index) {

Loading…
Cancel
Save