From 3c2171efb3dcec06ebfa0fd699ca4e06e7142bf1 Mon Sep 17 00:00:00 2001 From: Felipe Knorr Kuhn <100320+knorrium@users.noreply.github.com> Date: Mon, 4 Jul 2022 08:37:36 -0700 Subject: [PATCH] Fix WebSocket type error --- backend/src/api/websocket-handler.ts | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/backend/src/api/websocket-handler.ts b/backend/src/api/websocket-handler.ts index 9632b03e3..3c5b830cc 100644 --- a/backend/src/api/websocket-handler.ts +++ b/backend/src/api/websocket-handler.ts @@ -1,7 +1,9 @@ import logger from '../logger'; import * as WebSocket from 'ws'; -import { BlockExtended, TransactionExtended, WebsocketResponse, MempoolBlock, MempoolBlockDelta, - OptimizedStatistic, ILoadingIndicators, IConversionRates } from '../mempool.interfaces'; +import { + BlockExtended, TransactionExtended, WebsocketResponse, MempoolBlock, MempoolBlockDelta, + OptimizedStatistic, ILoadingIndicators, IConversionRates +} from '../mempool.interfaces'; import blocks from './blocks'; import memPool from './mempool'; import backendInfo from './backend-info'; @@ -164,7 +166,7 @@ class WebsocketHandler { throw new Error('WebSocket.Server is not set'); } - this.wss.clients.forEach((client: WebSocket) => { + this.wss.clients.forEach((client) => { if (client.readyState !== WebSocket.OPEN) { return; } @@ -179,7 +181,7 @@ class WebsocketHandler { throw new Error('WebSocket.Server is not set'); } - this.wss.clients.forEach((client: WebSocket) => { + this.wss.clients.forEach((client) => { if (client.readyState !== WebSocket.OPEN) { return; } @@ -192,7 +194,7 @@ class WebsocketHandler { throw new Error('WebSocket.Server is not set'); } - this.wss.clients.forEach((client: WebSocket) => { + this.wss.clients.forEach((client) => { if (client.readyState !== WebSocket.OPEN) { return; } @@ -224,7 +226,7 @@ class WebsocketHandler { throw new Error('WebSocket.Server is not set'); } - this.wss.clients.forEach((client: WebSocket) => { + this.wss.clients.forEach((client) => { if (client.readyState !== WebSocket.OPEN) { return; } @@ -255,7 +257,7 @@ class WebsocketHandler { memPool.handleRbfTransactions(rbfTransactions); const recommendedFees = feeApi.getRecommendedFee(); - this.wss.clients.forEach(async (client: WebSocket) => { + this.wss.clients.forEach(async (client) => { if (client.readyState !== WebSocket.OPEN) { return; }