fix: subscription RPC & added test subscriptions (#1587)

Co-authored-by: Sasha <118575614+weboko@users.noreply.github.com>
This commit is contained in:
Simon-Pierre Vivier 2023-09-25 18:24:49 -04:00 committed by GitHub
parent bcd65a1935
commit 6fa106aa7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 4 deletions

View File

@ -210,14 +210,13 @@ export class NimGoNode {
} }
async ensureSubscriptions( async ensureSubscriptions(
pubsubTopics: [string] = [DefaultPubSubTopic] pubsubTopics: string[] = [DefaultPubSubTopic]
): Promise<boolean> { ): Promise<boolean> {
this.checkProcess(); this.checkProcess();
return this.rpcCall<boolean>( return this.rpcCall<boolean>("post_waku_v2_relay_v1_subscriptions", [
"post_waku_v2_relay_v1_subscriptions",
pubsubTopics pubsubTopics
); ]);
} }
async sendMessage( async sendMessage(

View File

@ -25,6 +25,8 @@ describe("Waku Light Push [node only] - custom pubsub topic", function () {
nwaku, nwaku,
customPubSubTopic customPubSubTopic
); );
await nwaku.ensureSubscriptions([customPubSubTopic]);
}); });
this.afterEach(async function () { this.afterEach(async function () {

View File

@ -34,6 +34,8 @@ describe("Waku Light Push [node only]", function () {
nwaku, nwaku,
DefaultPubSubTopic DefaultPubSubTopic
); );
await nwaku.ensureSubscriptions();
}); });
this.afterEach(async function () { this.afterEach(async function () {