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

Commit 09703c3

Browse files
committed
fix: update dht responses
1 parent 8483084 commit 09703c3

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

js/src/dht/findpeer.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,9 @@ module.exports = (createCommon, options) => {
3838
after((done) => common.teardown(done))
3939

4040
it('should find other peers', (done) => {
41-
nodeA.dht.findpeer(nodeB.peerId.id, (err, peer) => {
41+
nodeA.dht.findpeer(nodeB.peerId.id, (err, res) => {
4242
expect(err).to.not.exist()
43-
// TODO upgrade the answer, format is weird
44-
expect(peer[0].Responses[0].ID).to.be.equal(nodeB.peerId.id)
43+
expect(nodeB.peerId.addresses).to.deep.eql(res.Responses[0].Addrs)
4544
done()
4645
})
4746
})

js/src/dht/findprovs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ module.exports = (createCommon, options) => {
6060
},
6161
(cidV0, cb) => nodeA.dht.findprovs(cidV0, cb),
6262
(provs, cb) => {
63-
expect(provs.map((p) => p.id.toB58String()))
63+
expect(provs.Responses.map((p) => p.ID))
6464
.to.eql([nodeB.peerId.id])
6565
cb()
6666
}

0 commit comments

Comments
 (0)