refactor debug to have a loading callback and move the actual debug call to it

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 3126c7293f
commit b63eeda4c7
  1. 5
      src/app/debugger/debugger/debugger.js
  2. 13
      src/app/debugger/debuggerUI.js

@ -76,7 +76,7 @@ Debugger.prototype.registerAndHighlightCodeItem = function (index) {
}) })
} }
Debugger.prototype.debug = function (parent) { Debugger.prototype.debug = function (parent, tx, loadingCb) {
const self = this const self = this
this.step_manager = new StepManager(this.debugger, this.debugger.traceManager) this.step_manager = new StepManager(this.debugger, this.debugger.traceManager)
parent.event.register('indexChanged', this, (index) => { parent.event.register('indexChanged', this, (index) => {
@ -92,6 +92,9 @@ Debugger.prototype.debug = function (parent) {
}) })
this.vmDebuggerLogic = new VmDebuggerLogic(parent, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree) this.vmDebuggerLogic = new VmDebuggerLogic(parent, this.debugger.traceManager, this.debugger.codeManager, this.debugger.solidityProxy, this.debugger.callTree)
loadingCb()
this.debugger.debug(tx)
} }
module.exports = Debugger module.exports = Debugger

@ -166,16 +166,15 @@ class DebuggerUI {
// still here because tx is being reffered in children // still here because tx is being reffered in children
this.tx = tx this.tx = tx
this.transactionDebugger.debug(this) this.transactionDebugger.debug(this, tx, () => {
this.stepManager = new StepManagerUI(this.transactionDebugger.step_manager) self.stepManager = new StepManagerUI(this.transactionDebugger.step_manager)
this.stepManager.event.register('stepChanged', this, function (stepIndex) { self.stepManager.event.register('stepChanged', this, function (stepIndex) {
self.stepChanged(stepIndex) self.stepChanged(stepIndex)
}) })
this.vmDebugger = new VmDebugger(this.transactionDebugger.vmDebuggerLogic) self.vmDebugger = new VmDebugger(this.transactionDebugger.vmDebuggerLogic)
this.andAddVmDebugger() self.andAddVmDebugger()
})
this.transactionDebugger.debugger.debug(tx)
} }
debug (txHash) { debug (txHash) {

Loading…
Cancel
Save