Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit d282a16

Browse files
committed
Address code review comments
1 parent 89a3691 commit d282a16

File tree

2 files changed

+14
-1
lines changed
  • packages
    • interface-ipfs-core/src/miscellaneous
    • ipfs/src/core/components

2 files changed

+14
-1
lines changed

packages/interface-ipfs-core/src/miscellaneous/id.js

+13
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,19 @@ module.exports = (common, options) => {
4949
const res = await ipfs.id()
5050

5151
expect(res).to.have.a.property('protocols').that.is.an('array')
52+
53+
expect(res.protocols).to.have.members([
54+
"/floodsub/1.0.0",
55+
"/ipfs/bitswap/1.0.0",
56+
"/ipfs/bitswap/1.1.0",
57+
"/ipfs/bitswap/1.2.0",
58+
"/ipfs/id/1.0.0",
59+
"/ipfs/id/push/1.0.0",
60+
"/ipfs/ping/1.0.0",
61+
"/libp2p/circuit/relay/0.1.0",
62+
"/meshsub/1.0.0",
63+
"/meshsub/1.1.0"
64+
])
5265
})
5366
})
5467
}

packages/ipfs/src/core/components/id.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = ({ peerId, libp2p }) => {
1414
if (libp2p) {
1515
// only available while the node is running
1616
addresses = libp2p.transportManager.getAddrs()
17-
protocols = libp2p.peerStore.protoBook.get(peerId) || []
17+
protocols = Array.from(libp2p.upgrader.protocols.keys())
1818
}
1919

2020
return {

0 commit comments

Comments
 (0)