Skip to content

Commit 905c911

Browse files
vasco-santosjacobheun
authored andcommitted
fix: peer routing for delegate router (libp2p#377)
* fix: peer routing tests * 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
1 parent 10811e9 commit 905c911

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/peer-routing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ module.exports = (node) => {
4747
})
4848

4949
tryEach(tasks, (err, results) => {
50-
if (err && err.code !== 'NOT_FOUND') {
50+
if (err) {
5151
return callback(err)
5252
}
5353
results = results || []

test/content-routing.node.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ describe('.contentRouting', () => {
251251
timeout: '1000ms',
252252
'stream-channels': true
253253
})
254-
.reply(200, `{"Extra":"","ID":"QmWKqWXCtRXEeCQTo3FoZ7g4AfnGiauYYiczvNxFCHicbB","Responses":[{"Addrs":["/ip4/0.0.0.0/tcp/0"],"ID":"${provider}"}],"Type":1}\n`, [
254+
.reply(200, `{"Extra":"","ID":"QmWKqWXCtRXEeCQTo3FoZ7g4AfnGiauYYiczvNxFCHicbB","Responses":[{"Addrs":["/ip4/0.0.0.0/tcp/0"],"ID":"${provider}"}],"Type":4}\n`, [
255255
'Content-Type', 'application/json',
256256
'X-Chunked-Output', '1'
257257
])

0 commit comments

Comments
 (0)