From 0bfcb2b8174b3b84f471c5dbb9e14ad70d38a8a4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 23 Dec 2020 15:01:14 +0100 Subject: [PATCH] pass the address to "newSourceLocation" listenners --- libs/remix-debug/src/debugger/debugger.ts | 2 +- libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libs/remix-debug/src/debugger/debugger.ts b/libs/remix-debug/src/debugger/debugger.ts index 9117a888bc..477f875ca2 100644 --- a/libs/remix-debug/src/debugger/debugger.ts +++ b/libs/remix-debug/src/debugger/debugger.ts @@ -82,7 +82,7 @@ export class Debugger { } } var lineColumnPos = this.offsetToLineColumnConverter.offsetToLineColumn(rawLocation, rawLocation.file, sources, astSources) - this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources]) + this.event.trigger('newSourceLocation', [lineColumnPos, rawLocation, generatedSources, address]) } else { this.event.trigger('newSourceLocation', [null]) } 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 f28ce848fb..eb46317e79 100644 --- a/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx +++ b/libs/remix-ui/debugger-ui/src/lib/debugger-ui.tsx @@ -72,12 +72,11 @@ export const DebuggerUI = (props: DebuggerUIProps) => { }) }) - debuggerInstance.event.register('newSourceLocation', async (lineColumnPos, rawLocation, generatedSources) => { + debuggerInstance.event.register('newSourceLocation', async (lineColumnPos, rawLocation, generatedSources, address) => { if (!lineColumnPos) return const contracts = await debuggerModule.fetchContractAndCompile( - currentReceipt.contractAddress || currentReceipt.to, + address || currentReceipt.contractAddress || currentReceipt.to, currentReceipt) - if (contracts) { let path = contracts.getSourceName(rawLocation.file) if (!path) { @@ -152,7 +151,9 @@ export const DebuggerUI = (props: DebuggerUIProps) => { offsetToLineColumnConverter: debuggerModule.offsetToLineColumnConverter, compilationResult: async (address) => { try { - return await debuggerModule.fetchContractAndCompile(address, currentReceipt) + const ret = await debuggerModule.fetchContractAndCompile(address, currentReceipt) + console.log('ok', ret) + return ret } catch (e) { console.error(e) }