remove tracking of revertion point out of button navigator

pull/1/head
Iuri Matias 6 years ago committed by yann300
parent 0f90202b5e
commit 05249bcccb
  1. 10
      src/app/debugger/debuggerUI/ButtonNavigator.js
  2. 12
      src/app/debugger/debuggerUI/StepManager.js

@ -66,7 +66,7 @@ ButtonNavigator.prototype.render = function () {
<button id='jumpnextbreakpoint' title='Jump to the next breakpoint' class='${css.navigator} ${css.jumpButton} fa fa-step-forward' onclick=${function () { self.event.trigger('jumpNextBreakpoint') }} disabled=${this.jumpNextBreakpointDisabled} ></button>
</div>
<div id='reverted' style="display:none">
<button id='jumptoexception' title='Jump to exception' class='${css.navigator} ${css.button} fa fa-exclamation-triangle' onclick=${function () { self.event.trigger('jumpToException', [self.revertionPoint]) }} disabled=${this.jumpOutDisabled} >
<button id='jumptoexception' title='Jump to exception' class='${css.navigator} ${css.button} fa fa-exclamation-triangle' onclick=${function () { self.event.trigger('jumpToException') }} disabled=${this.jumpOutDisabled} >
</button>
<span>State changes made during this call will be reverted.</span>
<span id='outofgas' style="display:none">This call will run out of gas.</span>
@ -128,14 +128,6 @@ ButtonNavigator.prototype.updateDisabled = function (id, disabled) {
}
}
ButtonNavigator.prototype.resetAndCheckRevertionPoint = function (revertedReason, revertionPoint) {
// TODO: since this is only used for the jump, this value should instead be outside of the view
if (revertionPoint) {
this.revertionPoint = revertionPoint
}
this.resetWarning(revertedReason)
}
ButtonNavigator.prototype.resetWarning = function (revertedReason) {
this.view.querySelector('#reverted #outofgas').style.display = (revertedReason === 'outofgas') ? 'inline' : 'none'
this.view.querySelector('#reverted #parenthasthrown').style.display = (revertedReason === 'parenthasthrown') ? 'inline' : 'none'

@ -13,6 +13,8 @@ function StepManager (_parent, _traceManager) {
this.sourceMapByAddress = {}
this.solidityMode = false
this.revertionPoint = null
var self = this
this.parent.event.register('newTraceLoaded', this, function () {
if (!this.slider) return
@ -58,7 +60,8 @@ function StepManager (_parent, _traceManager) {
if (self.currentCall.reverted) {
let revertedReason = self.currentCall.outofgas ? 'outofgas' : ''
if (self.buttonNavigator) {
self.buttonNavigator.resetAndCheckRevertionPoint(revertedReason, self.currentCall.return)
self.revertionPoint = self.currentCall.return
self.buttonNavigator.resetWarning(revertedReason)
}
} else {
var k = callsPath.length - 2
@ -67,7 +70,8 @@ function StepManager (_parent, _traceManager) {
if (parent.reverted) {
let revertedReason = parent ? 'parenthasthrown' : ''
if (self.buttonNavigator) {
return self.buttonNavigator.resetAndCheckRevertionPoint(revertedReason, parent.return)
self.revertionPoint = parent.return
self.buttonNavigator.resetWarning(revertedReason)
}
}
k--
@ -95,8 +99,8 @@ function StepManager (_parent, _traceManager) {
this.buttonNavigator.event.register('jumpOut', this, function () {
self.jumpOut()
})
this.buttonNavigator.event.register('jumpToException', this, function (exceptionIndex) {
self.jumpTo(exceptionIndex)
this.buttonNavigator.event.register('jumpToException', this, function () {
self.jumpTo(self.revertionPoint)
})
this.buttonNavigator.event.register('jumpNextBreakpoint', (exceptionIndex) => {
self.parent.breakpointManager.jumpNextBreakpoint(_parent.currentStepIndex, true)

Loading…
Cancel
Save