Skip to content

Commit

Permalink
fix: peer routing for delegate router (#377)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
vasco-santos authored and jacobheun committed Jul 12, 2019
1 parent 10811e9 commit 905c911
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/peer-routing.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ module.exports = (node) => {
})

tryEach(tasks, (err, results) => {
if (err && err.code !== 'NOT_FOUND') {
if (err) {
return callback(err)
}
results = results || []
Expand Down
2 changes: 1 addition & 1 deletion test/content-routing.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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'
])
Expand Down

0 comments on commit 905c911

Please sign in to comment.