From e84eb620f72dc24d319f7c7813f4b7411a232a6e Mon Sep 17 00:00:00 2001 From: Danish Arora Date: Wed, 9 Oct 2024 12:10:39 +0530 Subject: [PATCH] chore: update protocol health for lightpush --- packages/sdk/src/protocols/light_push/light_push.ts | 12 +++++++++++- .../tests/tests/health-manager/protocols.spec.ts | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/sdk/src/protocols/light_push/light_push.ts b/packages/sdk/src/protocols/light_push/light_push.ts index 9ddbac0fba..61e72487f7 100644 --- a/packages/sdk/src/protocols/light_push/light_push.ts +++ b/packages/sdk/src/protocols/light_push/light_push.ts @@ -1,5 +1,10 @@ import type { Peer, PeerId } from "@libp2p/interface"; -import { ConnectionManager, LightPushCodec, LightPushCore } from "@waku/core"; +import { + ConnectionManager, + getHealthManager, + LightPushCodec, + LightPushCore +} from "@waku/core"; import { Failure, type IEncoder, @@ -113,6 +118,11 @@ class LightPush extends BaseProtocolSDK implements ILightPush { } } + getHealthManager().updateProtocolHealth( + this.protocol.multicodec, + successes.length + ); + return { successes, failures diff --git a/packages/tests/tests/health-manager/protocols.spec.ts b/packages/tests/tests/health-manager/protocols.spec.ts index 09f0febe49..c23befdb6e 100644 --- a/packages/tests/tests/health-manager/protocols.spec.ts +++ b/packages/tests/tests/health-manager/protocols.spec.ts @@ -17,7 +17,7 @@ import { const NUM_NODES = [0, 1, 2, 3]; -describe("Health Manager", function () { +describe.only("Health Manager", function () { this.timeout(10_000); let waku: LightNode;