Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: update dht responses
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Nov 11, 2018
1 parent 8483084 commit 7575ec9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions js/src/dht/findpeer.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,9 @@ module.exports = (createCommon, options) => {
after((done) => common.teardown(done))

it('should find other peers', (done) => {
nodeA.dht.findpeer(nodeB.peerId.id, (err, peer) => {
nodeA.dht.findpeer(nodeB.peerId.id, (err, res) => {
expect(err).to.not.exist()
// TODO upgrade the answer, format is weird
expect(peer[0].Responses[0].ID).to.be.equal(nodeB.peerId.id)
expect(res.Responses[0].Addrs).to.deep.include(nodeB.peerId.addresses[0])
done()
})
})
Expand Down
2 changes: 1 addition & 1 deletion js/src/dht/findprovs.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ module.exports = (createCommon, options) => {
},
(cidV0, cb) => nodeA.dht.findprovs(cidV0, cb),
(provs, cb) => {
expect(provs.map((p) => p.id.toB58String()))
expect(provs.Responses.map((p) => p.ID))
.to.eql([nodeB.peerId.id])
cb()
}
Expand Down

0 comments on commit 7575ec9

Please sign in to comment.