Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Jan 9, 2024
1 parent 224bf85 commit 37f070f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/tests/src/waitForRemotePeerWithCodec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-console */
import type { IdentifyResult } from "@libp2p/interface";
import type { PeerId } from "@libp2p/interface/peer-id";
import type { LightNode } from "@waku/interfaces";
Expand All @@ -19,7 +20,11 @@ export async function waitForRemotePeerWithCodec(
const connectedPeers = waku.libp2p
.getConnections()
.map((conn) => conn.remotePeer);
if (connectedPeers.includes(nodePeerId)) {
console.log(connectedPeers);
if (
connectedPeers.find((connectedPeer) => connectedPeer.equals(nodePeerId))
) {
console.log("returning with connected peers");
return;
}

Expand Down

0 comments on commit 37f070f

Please sign in to comment.