Skip to content
This repository was archived by the owner on Jun 26, 2023. It is now read-only.

Commit d5dd256

Browse files
vasco-santosjacobheun
authored andcommitted
fix: multicodec topology disconnect with peer param (#12)
1 parent 3f6c1cb commit d5dd256

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/topology/multicodec-topology.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ class MulticodecTopology extends Topology {
7777

7878
// Not supporting the protocol anymore?
7979
if (existingPeer && hasProtocol.length === 0) {
80-
this._onDisconnect({
81-
peerInfo
82-
})
80+
this._onDisconnect(peerInfo)
8381
}
8482

8583
// New to protocol support

src/topology/tests/multicodec-topology.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ module.exports = (test) => {
8686

8787
expect(topology.peers.size).to.eql(1)
8888
expect(topology._onDisconnect.callCount).to.equal(1)
89+
expect(topology._onDisconnect.calledWith(peer2)).to.equal(true)
8990
})
9091
})
9192
}

0 commit comments

Comments
 (0)