From 41e09679c08c2b3be70acda2fd357c9b7e7ad561 Mon Sep 17 00:00:00 2001 From: robertlincecum Date: Mon, 21 Oct 2024 14:06:49 -0500 Subject: [PATCH] wip --- src/providers/provider-socket.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/providers/provider-socket.ts b/src/providers/provider-socket.ts index 3a675ed9..b59ddffc 100644 --- a/src/providers/provider-socket.ts +++ b/src/providers/provider-socket.ts @@ -188,6 +188,11 @@ export class SocketBlockSubscriber extends SocketSubscriber { * @category Providers */ export class SocketAccessesSubscriber extends SocketSubscriber { + #logFilter: string; + + get logFilter(): EventFilter { + return JSON.parse(this.#logFilter); + } /** * Creates a new **SocketBlockSubscriber**. * @@ -198,6 +203,7 @@ export class SocketAccessesSubscriber extends SocketSubscriber { */ constructor(provider: SocketProvider, filter: AccessesFilter, zone: Zone) { super(provider, ['accesses', filter.address], zone); + this.#logFilter = JSON.stringify(filter); } /** @@ -209,7 +215,7 @@ export class SocketAccessesSubscriber extends SocketSubscriber { * @returns {Promise} */ async _emit(provider: SocketProvider, message: any): Promise { - provider.emit('accesses', this.zone, message); + provider.emit(this.logFilter, this.zone, message); } }