mirror of
https://github.com/logos-messaging/logos-messaging-js.git
synced 2026-01-12 21:13:09 +00:00
* make relay folder * make relay folder * adjust message collector for relay * small fix * small fix * small fix * split tests more * small fixes * small fix * new test * fix pubsubtopic name * new subscribe tests * new subscribe tests * new tests * small fix after ci run * small fix after ci run2 * fix skipped test * added issue for skipped test
23 lines
613 B
TypeScript
23 lines
613 B
TypeScript
import { createDecoder, createEncoder, Decoder, Encoder } from "@waku/core";
|
|
|
|
// Utility to generate test data for multiple topics tests.
|
|
export function generateTestData(topicCount: number): {
|
|
contentTopics: string[];
|
|
encoders: Encoder[];
|
|
decoders: Decoder[];
|
|
} {
|
|
const contentTopics = Array.from(
|
|
{ length: topicCount },
|
|
(_, i) => `/test/${i + 1}/waku-multi`
|
|
);
|
|
const encoders = contentTopics.map((topic) =>
|
|
createEncoder({ contentTopic: topic })
|
|
);
|
|
const decoders = contentTopics.map((topic) => createDecoder(topic));
|
|
return {
|
|
contentTopics,
|
|
encoders,
|
|
decoders
|
|
};
|
|
}
|