From 25e7cc6e45a480999914979580c899b4fc0083f6 Mon Sep 17 00:00:00 2001 From: Christian Langenbacher Date: Sat, 26 Oct 2024 20:58:02 +0200 Subject: [PATCH] Revert "[rpc-provider] add debug logs" This reverts commit 62151334c18021770b0a221807e3a7355291d967. --- .../src/rpc-provider/src/ws/index.ts | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/packages/worker-api/src/rpc-provider/src/ws/index.ts b/packages/worker-api/src/rpc-provider/src/ws/index.ts index 288cce1f..21bf03d1 100644 --- a/packages/worker-api/src/rpc-provider/src/ws/index.ts +++ b/packages/worker-api/src/rpc-provider/src/ws/index.ts @@ -358,8 +358,6 @@ export class WsProvider implements ProviderInterface { }; l.debug(() => ['calling', method, body]); - console.log(`['calling', ${method}, ${body}]`); - console.log(`setting handler for id=${id}`); this.#handlers[id] = { callback, @@ -501,8 +499,6 @@ export class WsProvider implements ProviderInterface { const response = JSON.parse(message.data) as JsonRpcResponse; - console.log(`Json Response: ${JSON.stringify(response)}`); - return isUndefined(response.method) ? this.#onSocketMessageResult(response) : this.#onSocketMessageSubscribe(response); @@ -511,13 +507,8 @@ export class WsProvider implements ProviderInterface { #onSocketMessageResult = (response: JsonRpcResponse): void => { const handler = this.#handlers[response.id]; - console.log(`Json Result: ${JSON.stringify(response)}`); - console.log(`handler: ${JSON.stringify(this.#handlers)}`); - - if (!handler) { l.debug(() => `Unable to find handler for id=${response.id}`); - console.log(`Unable to find handler for id=${response.id}`); return; } @@ -532,16 +523,12 @@ export class WsProvider implements ProviderInterface { if (subscription) { const subId = `${subscription.type}::${result}`; - console.log(`subId: ${subId}`); - console.log(`it is as subscription: ${JSON.stringify(subscription)}}`); this.#subscriptions[subId] = objectSpread({}, subscription, { method, params }); - console.log(`subscriptions: ${JSON.stringify(this.#subscriptions)}`); - // if we have a result waiting for this subscription already if (this.#waitingForId[subId]) { this.#onSocketMessageSubscribe(this.#waitingForId[subId]); @@ -571,7 +558,6 @@ export class WsProvider implements ProviderInterface { this.#waitingForId[subId] = response; l.debug(() => `Unable to find handler for subscription=${subId}`); - console.log(`Unable to find handler for subscription=${subId}`); return; } @@ -580,16 +566,10 @@ export class WsProvider implements ProviderInterface { delete this.#waitingForId[subId]; try { - console.log(`Decoding Response=${subId}`); - const result = this.#coder.decodeResponse(response); - console.log(`Decoded Response=${subId}`); - handler.callback(null, result); } catch (error) { - console.log(`Failed to decode response=${(error as Error).message}`); - this.#endpointStats.errors++; this.#stats.total.errors++;