mirror of
https://github.com/waku-org/js-waku.git
synced 2025-02-10 11:26:58 +00:00
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
This commit is contained in:
parent
41b7ef17e1
commit
e0949dab04
@ -29,8 +29,6 @@ describe('Waku Dial [node only]', function () {
|
|||||||
waku ? await waku.stop() : null;
|
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 () {
|
it.skip('js connects to nim', async function () {
|
||||||
this.timeout(20_000);
|
this.timeout(20_000);
|
||||||
nimWaku = new NimWaku(makeLogFileName(this));
|
nimWaku = new NimWaku(makeLogFileName(this));
|
||||||
@ -119,13 +117,12 @@ describe('Waku Dial [node only]', function () {
|
|||||||
|
|
||||||
nimWaku = new NimWaku(makeLogFileName(this));
|
nimWaku = new NimWaku(makeLogFileName(this));
|
||||||
await nimWaku.start();
|
await nimWaku.start();
|
||||||
const multiAddrWithId = await nimWaku.getMultiaddrWithId();
|
|
||||||
|
|
||||||
waku = await Waku.create({
|
waku = await Waku.create({
|
||||||
staticNoiseKey: NOISE_KEY_1,
|
staticNoiseKey: NOISE_KEY_1,
|
||||||
bootstrap: {
|
bootstrap: {
|
||||||
getPeers: async () => {
|
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());
|
expect(connectedPeerID.toB58String()).to.eq(multiAddrWithId.getPeerId());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user