From 08a7f004c39b0669f3bb310bf3a21006bedbcbcf Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 22 Mar 2021 21:53:22 +1100 Subject: [PATCH 1/2] Missing protocols in identify message are now present status-im/nim-waku/issues/419 has been fixed. --- src/lib/waku_relay.spec.ts | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/src/lib/waku_relay.spec.ts b/src/lib/waku_relay.spec.ts index 1e92dc3394..e57826f8dd 100644 --- a/src/lib/waku_relay.spec.ts +++ b/src/lib/waku_relay.spec.ts @@ -1,5 +1,4 @@ import { expect } from 'chai'; -import Libp2p from 'libp2p'; import Pubsub from 'libp2p-interfaces/src/pubsub'; import { NimWaku } from '../test_utils/nim_waku'; @@ -99,8 +98,6 @@ describe('Waku Relay', () => { // https://github.com/status-im/nim-waku/issues/422 is fixed waku.libp2p.pubsub.globalSignaturePolicy = 'StrictSign'; - await patchPeerStore(nimWaku, waku.libp2p); - await waku.relay.publish(message); await nimWaku.waitForLog('WakuMessage received'); @@ -118,8 +115,6 @@ describe('Waku Relay', () => { this.timeout(5000); const message = Message.fromUtf8String('Here is another message.'); - await patchPeerStore(nimWaku, waku.libp2p); - await waku.relay.subscribe(); await new Promise((resolve) => @@ -148,19 +143,3 @@ function waitForNextData(pubsub: Pubsub): Promise { return Message.fromBinary(msg.data); }); } - -// TODO: Remove this hack, tracked with https://github.com/status-im/nim-waku/issues/419 -async function patchPeerStore(nimWaku: NimWaku, node: Libp2p) { - const nimPeerId = await nimWaku.getPeerId(); - node.identifyService!.peerStore.protoBook.set(nimPeerId, [CODEC]); - const peer = node.peerStore.peers.get(nimPeerId.toB58String()); - if (!peer) { - throw 'Did not find nim-waku node in peers'; - } - peer.protocols = [CODEC]; - node.peerStore.peers.set(nimPeerId.toB58String(), peer); - - await new Promise((resolve) => - node.pubsub.once('gossipsub:heartbeat', resolve) - ); -} From 01bc19e52c8d289d7ba8a59cd8f95dfe51678c75 Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Mon, 22 Mar 2021 22:06:10 +1100 Subject: [PATCH 2/2] Revert unnecessary ts config changes --- tsconfig.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index b3c2552ec6..5c85161103 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -42,9 +42,9 @@ "lib": ["es2017"], "types": ["node", "mocha"], - "typeRoots": ["node_modules/@types", "src/types", "src/gen/proto"] + "typeRoots": ["node_modules/@types", "src/types"] }, - "include": ["src/**/*.ts", "src/**/*.d.ts"], + "include": ["src/**/*.ts"], "exclude": ["node_modules/**"], "compileOnSave": false, "ts-node": {