Skip to content

Commit

Permalink
chore: address review
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Nov 15, 2019
1 parent 340edf5 commit b33aca0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
"libp2p-delegated-content-routing": "^0.2.2",
"libp2p-delegated-peer-routing": "^0.2.2",
"libp2p-floodsub": "^0.19.0",
"libp2p-gossipsub": "ChainSafe/gossipsub-js#refactor/async",
"libp2p-gossipsub": "ChainSafe/gossipsub-js#beta/async",
"libp2p-kad-dht": "^0.15.3",
"libp2p-mdns": "^0.12.3",
"libp2p-mplex": "^0.9.1",
Expand Down
4 changes: 1 addition & 3 deletions src/registrar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const log = debug('libp2p:peer-store')
log.error = debug('libp2p:peer-store:error')

const Topology = require('libp2p-interfaces/src/topology')
const MulticodecTopology = require('libp2p-interfaces/src/topology/multicodec-topology')
const { Connection } = require('libp2p-interfaces/src/connection')
const PeerInfo = require('peer-info')

Expand Down Expand Up @@ -112,8 +111,7 @@ class Registrar {
*/
register (topology) {
assert(
Topology.isTopology(topology) ||
MulticodecTopology.isMulticodecTopology(topology),
Topology.isTopology(topology),
'topology must be an instance of interfaces/topology')

// Create topology
Expand Down
5 changes: 4 additions & 1 deletion test/pubsub/operation.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,10 @@ describe('Pubsub subsystem operates correctly', () => {

remoteLibp2p.pubsub.start()

await pWaitFor(() => libp2p.pubsub._pubsub.peers.size === 1)
await pWaitFor(() =>
libp2p.pubsub._pubsub.peers.size === 1 &&
remoteLibp2p.pubsub._pubsub.peers.size === 1
)

expect(libp2p.pubsub._pubsub.peers.size).to.be.eql(1)
expect(remoteLibp2p.pubsub._pubsub.peers.size).to.be.eql(1)
Expand Down

0 comments on commit b33aca0

Please sign in to comment.