mirror of https://github.com/waku-org/js-waku.git
fix: peer-exchange go-waku interop (#1300)
* merge: master * fix: CI * use: js script instead of shell script to run precheck and mocha * check for peer id instead of ws multiaddr in response
This commit is contained in:
parent
306e38ba14
commit
b7d4b675bd
|
@ -9,11 +9,9 @@ const WAKUNODE_IMAGE =
|
|||
async function main() {
|
||||
try {
|
||||
await execAsync(`docker inspect ${WAKUNODE_IMAGE}`);
|
||||
|
||||
console.log("Using local image");
|
||||
} catch (error) {
|
||||
console.log("Pulling image...");
|
||||
|
||||
await execAsync(`docker pull ${WAKUNODE_IMAGE}`);
|
||||
console.log("Image pulled");
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ describe("Peer Exchange", () => {
|
|||
discv5BootstrapNode: enr,
|
||||
});
|
||||
|
||||
const nwaku1Ma = await nwaku1.getMultiaddrWithId();
|
||||
const nwaku1PeerId = await nwaku1.getPeerId();
|
||||
const nwaku2Ma = await nwaku2.getMultiaddrWithId();
|
||||
|
||||
waku = await createLightNode();
|
||||
|
@ -130,14 +130,12 @@ describe("Peer Exchange", () => {
|
|||
expect(peerInfos.length).to.be.lessThanOrEqual(numPeersToRequest);
|
||||
expect(peerInfos[0].ENR).to.not.be.null;
|
||||
|
||||
const doesMultiaddrExist =
|
||||
const doesPeerIdExistInResponse =
|
||||
peerInfos.find(
|
||||
(peerInfo) =>
|
||||
peerInfo.ENR?.getFullMultiaddrs()?.find((multiaddr) =>
|
||||
multiaddr.equals(nwaku1Ma)
|
||||
) !== undefined
|
||||
({ ENR }) => ENR?.peerInfo?.id.toString() === nwaku1PeerId.toString()
|
||||
) !== undefined;
|
||||
expect(doesMultiaddrExist).to.be.equal(true);
|
||||
|
||||
expect(doesPeerIdExistInResponse).to.be.equal(true);
|
||||
|
||||
expect(waku.libp2p.peerStore.has(await nwaku2.getPeerId())).to.be.true;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue