You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
.reply(200,`{"Extra":"","ID":"some other id","Responses":null,"Type":0}\n{"Extra":"","ID":"","Responses":[{"Addrs":["/ip4/127.0.0.1/tcp/4001"],"ID":"${peerKey}"}],"Type":2}\n`,[
'Content-Type','application/json',
'X-Chunked-Output','1'
])
constpeer=awaitnode.peerRouting.findPeer(peerKey)
expect(peer.id).to.equal(peerKey)
expect(mockApi.isDone()).to.equal(true)
})
Steps to reproduce the error:
git clone https://gist.github.com/a1300/79357f742a6e459a9a801e60bd2840ef libp2p-peerRouting-no-string
cd libp2p-peerRouting-no-string
npm install
node index
The text was updated successfully, but these errors were encountered:
The test mocks the response as the "real" tests for the delegate are in the delegate repo. As a result, what is provided in the parameter is not even used. Anyway, we should turn it into a PeerId with PeerId.createFromCID. Want to PR these changes?
Type: Bug
Severity: Low
Description:
peerRouting.findPeer()
does not accept string representations forPeerId
, it only acceptsPeerId
instancesThe
API.md#peerroutingfindpeer
saysfindPeer()
only acceptsPeerId
instancesOn the other hand the
JSDoc
type documentationfindPeer()
only acceptsstring
js-libp2p/src/peer-routing.js
Lines 14 to 23 in e9e4b73
If I understand the following test correctly, it uses
findPeer()
also with astring
js-libp2p/test/peer-routing/peer-routing.node.js
Lines 115 to 129 in e9e4b73
Steps to reproduce the error:
git clone https://gist.github.com/a1300/79357f742a6e459a9a801e60bd2840ef libp2p-peerRouting-no-string cd libp2p-peerRouting-no-string npm install node index
The text was updated successfully, but these errors were encountered: