Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danisharora099 committed Jan 17, 2024
1 parent 5a88d4b commit f2e66a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 5 additions & 2 deletions packages/tests/src/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,16 @@ export class ServiceNodes {

async sendRelayMessage(
message: MessageRpcQuery,
pubsubTopic: string = DefaultPubsubTopic,
pubsubTopic?: string,
raw = false
): Promise<boolean> {
let relayMessagePromises: Promise<boolean>[];
if (raw) {
relayMessagePromises = this.nodes.map((node) =>
node.rpcCall<boolean>("post_waku_v2_relay_v1_message", [message])
node.rpcCall<boolean>("post_waku_v2_relay_v1_message", [
pubsubTopic && pubsubTopic,
message
])
);
} else {
relayMessagePromises = this.nodes.map((node) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () {
}
});

it("Overlapping topic subscription", async function () {
it.only("Overlapping topic subscription", async function () {
// Define two sets of test data with overlapping topics.
const topicCount1 = 2;
const td1 = generateTestData(topicCount1);
Expand All @@ -281,15 +281,16 @@ describe("Waku Filter V2: Subscribe: Single Service Node", function () {

// Send messages to the first set of topics.
for (let i = 0; i < topicCount1; i++) {
const messageText = `Message for Topic ${i + 1}`;
const messageText = `Topic Set 1: Message Number: ${i + 1}`;
await waku.lightPush.send(td1.encoders[i], {
payload: utf8ToBytes(messageText)
});
}

// Send messages to the second set of topics.
for (let i = 0; i < topicCount2; i++) {
const messageText = `Message for Topic ${i + 1}`;
const messageText = `Topic Set 2: Message Number: ${i + 1}`;

await waku.lightPush.send(td2.encoders[i], {
payload: utf8ToBytes(messageText)
});
Expand Down

0 comments on commit f2e66a6

Please sign in to comment.