From d868b3c3db19880c966356c8c93dec65b706dfc5 Mon Sep 17 00:00:00 2001 From: filip mertens Date: Wed, 7 Dec 2022 11:07:44 +0100 Subject: [PATCH] debugger fix --- apps/debugger/src/app/debugger-api.ts | 4 +++- apps/debugger/src/app/debugger.ts | 4 ++-- libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx | 2 +- libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/debugger/src/app/debugger-api.ts b/apps/debugger/src/app/debugger-api.ts index f33c46763b..d715911552 100644 --- a/apps/debugger/src/app/debugger-api.ts +++ b/apps/debugger/src/app/debugger-api.ts @@ -172,14 +172,16 @@ export const DebuggerApiMixin = (Base) => class extends Base { showMessage (title: string, message: string) {} - onStartDebugging () { + onStartDebugging (debuggerBackend: any) { this.call('layout', 'maximiseSidePanel') this.emit('startDebugging') + this.debuggerBackend = debuggerBackend } onStopDebugging () { this.call('layout', 'resetSidePanel') this.emit('stopDebugging') + this.debuggerBackend = null } } diff --git a/apps/debugger/src/app/debugger.ts b/apps/debugger/src/app/debugger.ts index eee4d77ffd..fb8f769c19 100644 --- a/apps/debugger/src/app/debugger.ts +++ b/apps/debugger/src/app/debugger.ts @@ -4,7 +4,7 @@ import { IDebuggerApi, LineColumnLocation, onBreakpointClearedListener, onBreakpointAddedListener, onEditorContentChanged, onEnvChangedListener, TransactionReceipt } from '@remix-ui/debugger-ui' import { DebuggerApiMixin } from './debugger-api' import { CompilerAbstract } from '@remix-project/remix-solidity' - + export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) { constructor () { super() @@ -25,7 +25,7 @@ export class DebuggerClientApi extends DebuggerApiMixin(PluginClient) { setFile: (path: string, content: string) => Promise getDebugWeb3: () => any // returns an instance of web3.js, if applicable (mainet, goerli, ...) it returns a reference to a node from devops (so we are sure debug endpoint is available) web3: () => any // returns an instance of web3.js - onStartDebugging: () => void // called when debug starts + onStartDebugging: (debuggerBackend: any) => void // called when debug starts onStopDebugging: () => void // called when debug stops } diff --git a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx index 6ea07f3d5e..1f044edc05 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -296,7 +296,7 @@ export const DebuggerUI = (props: DebuggerUIProps) => { }) setTimeout(async() => { - debuggerModule.onStartDebugging() + debuggerModule.onStartDebugging(debuggerInstance) try { await debuggerInstance.debug(blockNumber, txNumber, tx, () => { listenToEvents(debuggerInstance, currentReceipt) diff --git a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts index ae688027d2..ea7abf9e69 100644 --- a/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts +++ b/libs/remix-ui/debugger-ui/src/lib/idebugger-api.ts @@ -51,7 +51,7 @@ export interface IDebuggerApi { getDebugWeb3: () => any // returns an instance of web3.js, if applicable (mainet, goerli, ...) it returns a reference to a node from devops (so we are sure debug endpoint is available) web3: () => any // returns an instance of web3.js showMessage (title: string, message: string): void - onStartDebugging (): void // called when debug starts + onStartDebugging (debuggerBackend: any): void // called when debug starts onStopDebugging (): void // called when debug stops }