Commit be67786a authored by Iuri Matias's avatar Iuri Matias Committed by yann300

remove UI debugger start and move it to a single method

parent fb837632
......@@ -160,8 +160,19 @@ class DebuggerUI {
startDebugging (blockNumber, txNumber, tx) {
const self = this
let shouldOpenDebugger = this.UIstartDebugging(blockNumber, txNumber, tx)
if (!shouldOpenDebugger) return
if (this.debugger.traceManager.isLoading) {
return
}
this.tx = tx
this.debugger.codeManager.event.register('changed', this, (code, address, instIndex) => {
self.debugger.callTree.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, this.currentStepIndex, this.debugger.solidityProxy.contracts, (error, sourceLocation) => {
if (!error) {
self.event.trigger('sourceLocationChanged', [sourceLocation])
}
})
})
this.transactionDebugger.step_manager = new StepManager(this, this.transactionDebugger.debugger.traceManager)
this.stepManager = new StepManagerUI(this.transactionDebugger.step_manager)
......@@ -235,25 +246,6 @@ class DebuggerUI {
this.event.trigger('indexChanged', [stepIndex])
}
UIstartDebugging (blockNumber, txIndex, tx) {
const self = this
if (this.debugger.traceManager.isLoading) {
return false
}
this.tx = tx
this.debugger.codeManager.event.register('changed', this, (code, address, instIndex) => {
self.debugger.callTree.sourceLocationTracker.getSourceLocationFromVMTraceIndex(address, this.currentStepIndex, this.debugger.solidityProxy.contracts, (error, sourceLocation) => {
if (!error) {
self.event.trigger('sourceLocationChanged', [sourceLocation])
}
})
})
return true
}
andAddVmDebugger () {
yo.update(this.debuggerHeadPanelsView, this.vmDebugger.renderHead())
yo.update(this.debuggerPanelsView, this.vmDebugger.render())
......
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