move return value logic and transform it into an event

pull/3094/head
Iuri Matias 6 years ago committed by yann300
parent dbc3c63382
commit 1b6626054d
  1. 22
      src/app/debugger/debuggerUI/VmDebugger.js

@ -149,6 +149,14 @@ class VmDebuggerLogic {
self._traceManager.getRemainingGas(index, function (error, remaining) { self._traceManager.getRemainingGas(index, function (error, remaining) {
self.event.trigger('traceRemainingGasUpdate', [error, remaining]) self.event.trigger('traceRemainingGasUpdate', [error, remaining])
}) })
self._traceManager.getReturnValue(index, function (error, returnValue) {
if (error) {
self.event.trigger('traceReturnValueUpdate', [[error]])
} else if (self._parentUI.currentStepIndex === index) {
self.event.trigger('traceReturnValueUpdate', [[returnValue]])
}
})
}) })
} }
@ -234,21 +242,9 @@ function VmDebugger (_parentUI, _traceManager, _codeManager, _solidityProxy, _ca
}) })
this.debuggerSolidityLocals.init() this.debuggerSolidityLocals.init()
/* Return values - */
this.returnValuesPanel = new DropdownPanel('Return Value', {json: true}) this.returnValuesPanel = new DropdownPanel('Return Value', {json: true})
this.returnValuesPanel.data = {} this.returnValuesPanel.data = {}
_parentUI.event.register('indexChanged', this.returnValuesPanel, function (index) { this.debuggerSolidityLocals.event.register('traceReturnValueUpdate', this.returnValuesPanel.update.bind(this.returnValuesPanel))
if (!self.view) return
var innerself = this
_traceManager.getReturnValue(index, function (error, returnValue) {
if (error) {
innerself.update([error])
} else if (_parentUI.currentStepIndex === index) {
innerself.update([returnValue])
}
})
})
/* Return values - */
this.fullStoragesChangesPanel = new FullStoragesChangesPanel(_parentUI, _traceManager) this.fullStoragesChangesPanel = new FullStoragesChangesPanel(_parentUI, _traceManager)
this.addresses = [] this.addresses = []

Loading…
Cancel
Save