diff --git a/src/app/debugger/debugger/debugger.js b/src/app/debugger/debugger/debugger.js index 65c308d415..1000e719b5 100644 --- a/src/app/debugger/debugger/debugger.js +++ b/src/app/debugger/debugger/debugger.js @@ -90,6 +90,13 @@ Debugger.prototype.debug = function (tx, loadingCb) { this.vmDebuggerLogic = new VmDebuggerLogic(this.debugger, tx, this.step_manager, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree) + this.step_manager.event.register('stepChanged', this, function (stepIndex) { + self.debugger.codeManager.resolveStep(stepIndex, tx) + self.step_manager.event.trigger('indexChanged', [stepIndex]) + self.vmDebuggerLogic.event.trigger('indexChanged', [stepIndex]) + self.registerAndHighlightCodeItem(stepIndex) + }) + loadingCb() this.debugger.debug(tx) } diff --git a/src/app/debugger/debuggerUI.js b/src/app/debugger/debuggerUI.js index 126c60522b..c3b7ace5ed 100644 --- a/src/app/debugger/debuggerUI.js +++ b/src/app/debugger/debuggerUI.js @@ -147,19 +147,8 @@ class DebuggerUI { return } - // TODO: move this to a param to .debug() - // still here because tx is being reffered in children - this.tx = tx - this.transactionDebugger.debug(tx, () => { self.stepManager = new StepManagerUI(this.transactionDebugger.step_manager) - self.transactionDebugger.step_manager.event.register('stepChanged', this, function (stepIndex) { - self.transactionDebugger.debugger.codeManager.resolveStep(stepIndex, self.tx) - self.transactionDebugger.step_manager.event.trigger('indexChanged', [stepIndex]) - self.transactionDebugger.vmDebuggerLogic.event.trigger('indexChanged', [stepIndex]) - self.transactionDebugger.registerAndHighlightCodeItem(stepIndex) - }) - self.vmDebugger = new VmDebugger(this.transactionDebugger.vmDebuggerLogic) self.andAddVmDebugger() })