From e0949dab047bf2e229676a2b255ba518ff93bea1 Mon Sep 17 00:00:00 2001 From: Franck R Date: Mon, 24 Jan 2022 18:46:06 +1100 Subject: [PATCH] Pass truly async function to `getPeers`, remove TODO (#428) * Pass truly async function to `getPeers` * Confirmed nim-waku's RPC API only returned managed peers --- src/lib/waku.node.spec.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/waku.node.spec.ts b/src/lib/waku.node.spec.ts index cd15a7dd52..5421ed9f83 100644 --- a/src/lib/waku.node.spec.ts +++ b/src/lib/waku.node.spec.ts @@ -29,8 +29,6 @@ describe('Waku Dial [node only]', function () { waku ? await waku.stop() : null; }); - // TODO: Clarify whether nwaku's `get_waku_v2_admin_v1_peers` can be expected - // to return peers with inbound connections. it.skip('js connects to nim', async function () { this.timeout(20_000); nimWaku = new NimWaku(makeLogFileName(this)); @@ -119,13 +117,12 @@ describe('Waku Dial [node only]', function () { nimWaku = new NimWaku(makeLogFileName(this)); await nimWaku.start(); - const multiAddrWithId = await nimWaku.getMultiaddrWithId(); waku = await Waku.create({ staticNoiseKey: NOISE_KEY_1, bootstrap: { getPeers: async () => { - return [multiAddrWithId]; + return [await nimWaku.getMultiaddrWithId()]; }, }, }); @@ -136,6 +133,7 @@ describe('Waku Dial [node only]', function () { }); }); + const multiAddrWithId = await nimWaku.getMultiaddrWithId(); expect(connectedPeerID.toB58String()).to.eq(multiAddrWithId.getPeerId()); }); });