mirror of https://github.com/waku-org/js-waku.git
test: Ensure pubsub topic is used when sending and retrieving messages
This commit is contained in:
parent
4a96472084
commit
953bda781f
|
@ -82,6 +82,7 @@ describe("Waku Light Push [node only]", () => {
|
|||
dbg("Send message via lightpush");
|
||||
const pushResponse = await waku.lightPush.push(message, {
|
||||
peerId: nimPeerId,
|
||||
pubSubTopic: customPubSubTopic,
|
||||
});
|
||||
dbg("Ack received", pushResponse);
|
||||
expect(pushResponse?.isSuccess).to.be.true;
|
||||
|
|
|
@ -217,7 +217,9 @@ export class Nwaku {
|
|||
]);
|
||||
}
|
||||
|
||||
async messages(pubsubTopic?: string): Promise<WakuMessage[]> {
|
||||
async messages(
|
||||
pubsubTopic: string = DefaultPubSubTopic
|
||||
): Promise<WakuMessage[]> {
|
||||
this.checkProcess();
|
||||
|
||||
const isDefined = (msg: WakuMessage | undefined): msg is WakuMessage => {
|
||||
|
@ -226,7 +228,7 @@ export class Nwaku {
|
|||
|
||||
const protoMsgs = await this.rpcCall<proto.WakuMessage[]>(
|
||||
"get_waku_v2_relay_v1_messages",
|
||||
[pubsubTopic ?? DefaultPubSubTopic]
|
||||
[pubsubTopic]
|
||||
);
|
||||
|
||||
const msgs = await Promise.all(
|
||||
|
|
Loading…
Reference in New Issue