debug: fixing peer exchange tests (#1990)

Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
This commit is contained in:
gabrielmer 2024-04-29 12:22:36 +03:00 committed by GitHub
parent f3627c46a4
commit 1562f0fd6f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 11 additions and 3 deletions

View File

@ -5,7 +5,11 @@ import {
} from "@waku/core/lib/predefined_bootstrap_nodes"; } from "@waku/core/lib/predefined_bootstrap_nodes";
import { wakuPeerExchangeDiscovery } from "@waku/discovery"; import { wakuPeerExchangeDiscovery } from "@waku/discovery";
import type { LightNode } from "@waku/interfaces"; import type { LightNode } from "@waku/interfaces";
import { createLightNode, DefaultPubsubTopic } from "@waku/sdk"; import { createLightNode } from "@waku/sdk";
import {
singleShardInfosToShardInfo,
singleShardInfoToPubsubTopic
} from "@waku/utils";
import { expect } from "chai"; import { expect } from "chai";
import { afterEachCustom, tearDownNodes } from "../../src"; import { afterEachCustom, tearDownNodes } from "../../src";
@ -28,13 +32,17 @@ describe("Peer Exchange", () => {
this.timeout(50_000); this.timeout(50_000);
const predefinedNodes = getPredefinedBootstrapNodes(name, nodes); const predefinedNodes = getPredefinedBootstrapNodes(name, nodes);
const singleShardInfo = { clusterId: 1, shard: 1 };
const shardInfo = singleShardInfosToShardInfo([singleShardInfo]);
const pubsubTopic = singleShardInfoToPubsubTopic(singleShardInfo);
waku = await createLightNode({ waku = await createLightNode({
libp2p: { libp2p: {
peerDiscovery: [ peerDiscovery: [
bootstrap({ list: predefinedNodes }), bootstrap({ list: predefinedNodes }),
wakuPeerExchangeDiscovery([DefaultPubsubTopic]) wakuPeerExchangeDiscovery([pubsubTopic])
] ]
} },
shardInfo: shardInfo
}); });
await waku.start(); await waku.start();