From c4dc232d16ae25a68022e79b2d4cc7c70fbf8761 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 16 Feb 2022 13:50:49 +0100 Subject: [PATCH] fix displaying reverted calls in debugger --- libs/remix-debug/src/debugger/stepManager.ts | 13 ++++++++----- .../src/lib/button-navigator/button-navigator.css | 4 ++++ .../src/lib/button-navigator/button-navigator.tsx | 9 ++++----- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/libs/remix-debug/src/debugger/stepManager.ts b/libs/remix-debug/src/debugger/stepManager.ts index 1a64977e97..6fd2e5fa22 100644 --- a/libs/remix-debug/src/debugger/stepManager.ts +++ b/libs/remix-debug/src/debugger/stepManager.ts @@ -51,15 +51,18 @@ export class DebuggerStepManager { this.traceManager.buildCallPath(index).then((callsPath) => { this.currentCall = callsPath[callsPath.length - 1] if (this.currentCall.reverted) { - const revertedReason = this.currentCall.outofgas ? 'outofgas' : '' + const revertedReason = this.currentCall.outofgas ? 'outofgas' : 'reverted' this.revertionPoint = this.currentCall.return - return this.event.trigger('revertWarning', [revertedReason]) + this.event.trigger('revertWarning', [revertedReason]) + return } for (let k = callsPath.length - 2; k >= 0; k--) { const parent = callsPath[k] - if (!parent.reverted) continue - this.revertionPoint = parent.return - this.event.trigger('revertWarning', ['parenthasthrown']) + if (parent.reverted) { + this.revertionPoint = parent.return + this.event.trigger('revertWarning', ['parenthasthrown']) + return + } } this.event.trigger('revertWarning', ['']) }).catch((error) => { diff --git a/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.css b/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.css index 8990810a9e..835b54615b 100644 --- a/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.css +++ b/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.css @@ -19,4 +19,8 @@ .navigator { } .navigator:hover { +} + +.cursorPointerRemixDebugger { + cursor: pointer; } \ No newline at end of file diff --git a/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.tsx b/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.tsx index 680c3b9ef8..5200de41f7 100644 --- a/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/button-navigator/button-navigator.tsx @@ -65,11 +65,10 @@ export const ButtonNavigation = ({ stepOverBack, stepIntoBack, stepIntoForward,
- - State changes made during this call will be reverted. - This call will run out of gas. - The parent call will throw an exception + This call has reverted, state changes made during the call will be reverted. + This call will run out of gas. + The parent call will throw an exception +
Click { jumpToException && jumpToException() }}>here to jump where the call reverted.
)