mirror of https://github.com/waku-org/js-waku.git
Use multiaddr lib instead of string parsing
This commit is contained in:
parent
a7c666f108
commit
a0d6784e3c
|
@ -1,5 +1,6 @@
|
||||||
import test from 'ava';
|
import test from 'ava';
|
||||||
import Pubsub from 'libp2p-interfaces/src/pubsub';
|
import Pubsub from 'libp2p-interfaces/src/pubsub';
|
||||||
|
import multiaddr from 'multiaddr';
|
||||||
|
|
||||||
import { delay } from '../test_utils/delay';
|
import { delay } from '../test_utils/delay';
|
||||||
import { NimWaku } from '../test_utils/nim_waku';
|
import { NimWaku } from '../test_utils/nim_waku';
|
||||||
|
@ -96,7 +97,7 @@ test('Nim-interop: js node subscribes to default waku topic (only checking js si
|
||||||
await wakuRelayNode.subscribe();
|
await wakuRelayNode.subscribe();
|
||||||
|
|
||||||
const nimAddress = await nimWaku.info().then((info) => info.listenStr);
|
const nimAddress = await nimWaku.info().then((info) => info.listenStr);
|
||||||
const nimPeerId = nimAddress.match(/[\d\w]+$/)[0];
|
const nimPeerId = multiaddr(nimAddress).getPeerId();
|
||||||
const subscribers = node.pubsub.getSubscribers(TOPIC);
|
const subscribers = node.pubsub.getSubscribers(TOPIC);
|
||||||
|
|
||||||
t.true(subscribers.includes(nimPeerId));
|
t.true(subscribers.includes(nimPeerId));
|
||||||
|
|
Loading…
Reference in New Issue