From b2caf10d034bedd0b18c37dc0f1d23e39a7c200a Mon Sep 17 00:00:00 2001 From: Danish Arora <35004822+danisharora099@users.noreply.github.com> Date: Tue, 23 May 2023 23:45:08 +0530 Subject: [PATCH] fix: go-waku interop tests (#1378) * fix interop for filter v1 * change to better desc --- packages/tests/src/node/interfaces.ts | 2 ++ packages/tests/src/node/node.ts | 7 +++++-- packages/tests/tests/enr.node.spec.ts | 1 + packages/tests/tests/filter_v1.node.spec.ts | 7 ++++++- packages/tests/tests/utils.spec.ts | 7 ++++++- 5 files changed, 20 insertions(+), 4 deletions(-) diff --git a/packages/tests/src/node/interfaces.ts b/packages/tests/src/node/interfaces.ts index 5a530d6e12..dceb75427f 100644 --- a/packages/tests/src/node/interfaces.ts +++ b/packages/tests/src/node/interfaces.ts @@ -22,6 +22,8 @@ export interface Args { websocketPort?: number; discv5BootstrapNode?: string; discv5UdpPort?: number; + // `legacyFilter` is required to enable filter v1 with go-waku + legacyFilter?: boolean; } export enum LogLevel { diff --git a/packages/tests/src/node/node.ts b/packages/tests/src/node/node.ts index 80375b8640..fe269eb125 100644 --- a/packages/tests/src/node/node.ts +++ b/packages/tests/src/node/node.ts @@ -122,6 +122,9 @@ export class NimGoNode { this.rpcPort = rpcPort; this.websocketPort = websocketPort; + // `legacyFilter` is required to enable filter v1 with go-waku + const { legacyFilter = false, ..._args } = args; + // Object.assign overrides the properties with the source (if there are conflicts) Object.assign( mergedArgs, @@ -130,10 +133,10 @@ export class NimGoNode { tcpPort, websocketPort, ...(args?.peerExchange && { discv5UdpPort }), - ...(isGoWaku && { minRelayPeersToPublish: 0 }), + ...(isGoWaku && { minRelayPeersToPublish: 0, legacyFilter }), }, { rpcAddress: "0.0.0.0" }, - args + _args ); process.env.WAKUNODE2_STORE_MESSAGE_DB_URL = ""; diff --git a/packages/tests/tests/enr.node.spec.ts b/packages/tests/tests/enr.node.spec.ts index e80c6dab73..ca843c5573 100644 --- a/packages/tests/tests/enr.node.spec.ts +++ b/packages/tests/tests/enr.node.spec.ts @@ -90,6 +90,7 @@ describe("ENR Interop: NimGoNode", function () { store: true, filter: true, lightpush: true, + legacyFilter: true, }); const multiAddrWithId = await nwaku.getMultiaddrWithId(); diff --git a/packages/tests/tests/filter_v1.node.spec.ts b/packages/tests/tests/filter_v1.node.spec.ts index 676d141362..630d20d2a6 100644 --- a/packages/tests/tests/filter_v1.node.spec.ts +++ b/packages/tests/tests/filter_v1.node.spec.ts @@ -36,7 +36,12 @@ describe("Waku Filter: V1", () => { beforeEach(async function () { this.timeout(15000); nwaku = new NimGoNode(makeLogFileName(this)); - await nwaku.start({ filter: true, lightpush: true, relay: true }); + await nwaku.start({ + filter: true, + lightpush: true, + relay: true, + legacyFilter: true, + }); waku = await createLightNode({ useFilterV1: true, staticNoiseKey: NOISE_KEY_1, diff --git a/packages/tests/tests/utils.spec.ts b/packages/tests/tests/utils.spec.ts index 2f41ea4481..f3bd2ca7b2 100644 --- a/packages/tests/tests/utils.spec.ts +++ b/packages/tests/tests/utils.spec.ts @@ -27,7 +27,12 @@ describe("Util: toAsyncIterator: FilterV1", () => { beforeEach(async function () { this.timeout(15000); nwaku = new NimGoNode(makeLogFileName(this)); - await nwaku.start({ filter: true, lightpush: true, relay: true }); + await nwaku.start({ + filter: true, + lightpush: true, + relay: true, + legacyFilter: true, + }); waku = await createLightNode({ useFilterV1: true, staticNoiseKey: NOISE_KEY_1,