From d0d6b7e2ba4c96876025de377a46e6663b696460 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Fri, 12 Jul 2019 13:00:50 +0200 Subject: [PATCH 1/2] fix: peer routing tests --- src/peer-routing.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/peer-routing.js b/src/peer-routing.js index b69787a818..998c802328 100644 --- a/src/peer-routing.js +++ b/src/peer-routing.js @@ -47,7 +47,7 @@ module.exports = (node) => { }) tryEach(tasks, (err, results) => { - if (err && err.code !== 'NOT_FOUND') { + if (err) { return callback(err) } results = results || [] From 76a9b37e524756da32a27ce589f947afe93ca2f2 Mon Sep 17 00:00:00 2001 From: Jacob Heun Date: Fri, 12 Jul 2019 12:46:18 +0100 Subject: [PATCH 2/2] test: fix mock payload type Provider results are type 4, not type 1: https://github.com/libp2p/go-libp2p-core/blob/6e566d10f4a5447317a66d64c7459954b969bdab/routing/query.go#L15-L24 --- test/content-routing.node.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/content-routing.node.js b/test/content-routing.node.js index d015690c31..9c7eecde50 100644 --- a/test/content-routing.node.js +++ b/test/content-routing.node.js @@ -251,7 +251,7 @@ describe('.contentRouting', () => { timeout: '1000ms', 'stream-channels': true }) - .reply(200, `{"Extra":"","ID":"QmWKqWXCtRXEeCQTo3FoZ7g4AfnGiauYYiczvNxFCHicbB","Responses":[{"Addrs":["/ip4/0.0.0.0/tcp/0"],"ID":"${provider}"}],"Type":1}\n`, [ + .reply(200, `{"Extra":"","ID":"QmWKqWXCtRXEeCQTo3FoZ7g4AfnGiauYYiczvNxFCHicbB","Responses":[{"Addrs":["/ip4/0.0.0.0/tcp/0"],"ID":"${provider}"}],"Type":4}\n`, [ 'Content-Type', 'application/json', 'X-Chunked-Output', '1' ])