From 462d6147013ad731568516ae94be950728648381 Mon Sep 17 00:00:00 2001 From: Danish Arora <35004822+danisharora099@users.noreply.github.com> Date: Thu, 10 Aug 2023 11:53:53 +0530 Subject: [PATCH] refactor peer exchange compliance test (#1468) --- packages/tests/tests/peer_exchange.node.spec.ts | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/packages/tests/tests/peer_exchange.node.spec.ts b/packages/tests/tests/peer_exchange.node.spec.ts index 29c9a5ec89..19a06709c1 100644 --- a/packages/tests/tests/peer_exchange.node.spec.ts +++ b/packages/tests/tests/peer_exchange.node.spec.ts @@ -4,7 +4,6 @@ import { PeerExchangeCodec, PeerExchangeDiscovery, WakuPeerExchange, - wakuPeerExchangeDiscovery, } from "@waku/peer-exchange"; import { createLightNode, Libp2pComponents } from "@waku/sdk"; import { expect } from "chai"; @@ -114,21 +113,13 @@ describe("Peer Exchange", () => { discv5BootstrapNode: enr, }); - waku = await createLightNode({ - libp2p: { - peerDiscovery: [wakuPeerExchangeDiscovery()], - }, - }); - const peerExchange = waku.libp2p.components["components"][ - "peer-discovery-0" - ] as PeerExchangeDiscovery; - + waku = await createLightNode(); await waku.start(); - const nwaku2Ma = await nwaku2.getMultiaddrWithId(); + const nwaku2Ma = await nwaku2.getMultiaddrWithId(); await waku.libp2p.dialProtocol(nwaku2Ma, PeerExchangeCodec); - return peerExchange; + return new PeerExchangeDiscovery(waku.libp2p.components); }, teardown: async () => { await nwaku1?.stop();