Commit 46cc1235 authored by Iuri Matias's avatar Iuri Matias Committed by yann300

move memory event to vmdebugger class

parent 1d60bc4c
...@@ -80,6 +80,15 @@ class VmDebuggerLogic { ...@@ -80,6 +80,15 @@ class VmDebuggerLogic {
self.event.trigger('traceManagerCallDataUpdate', [calldata]) self.event.trigger('traceManagerCallDataUpdate', [calldata])
} }
}) })
self._traceManager.getMemoryAt(index, function (error, memory) {
if (error) {
console.log(error)
self.event.trigger('traceManagerMemoryUpdate', [{}])
} else if (self._parentUI.currentStepIndex === index) {
self.event.trigger('traceManagerMemoryUpdate', [ui.formatMemory(memory, 16)])
}
})
}) })
} }
...@@ -101,19 +110,7 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca ...@@ -101,19 +110,7 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca
this.vmDebuggerLogic.event.register('traceManagerCallDataUpdate', this.calldataPanel.update.bind(this.calldataPanel)) this.vmDebuggerLogic.event.register('traceManagerCallDataUpdate', this.calldataPanel.update.bind(this.calldataPanel))
this.memoryPanel = new MemoryPanel() this.memoryPanel = new MemoryPanel()
_parentUI.event.register('indexChanged', this, function (index) { this.vmDebuggerLogic.event.register('traceManagerMemoryUpdate', this.memoryPanel.update.bind(this.memoryPanel))
if (index < 0) return
if (_parentUI.currentStepIndex !== index) return
_traceManager.getMemoryAt(index, function (error, memory) {
if (error) {
console.log(error)
self.memoryPanel.update({})
} else if (_parentUI.currentStepIndex === index) {
self.memoryPanel.update(ui.formatMemory(memory, 16))
}
})
})
this.callstackPanel = new CallstackPanel() this.callstackPanel = new CallstackPanel()
_parentUI.event.register('indexChanged', this, function (index) { _parentUI.event.register('indexChanged', this, function (index) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment