diff --git a/src/topology/multicodec-topology.js b/src/topology/multicodec-topology.js index fe1303c..9b06875 100644 --- a/src/topology/multicodec-topology.js +++ b/src/topology/multicodec-topology.js @@ -77,9 +77,7 @@ class MulticodecTopology extends Topology { // Not supporting the protocol anymore? if (existingPeer && hasProtocol.length === 0) { - this._onDisconnect({ - peerInfo - }) + this._onDisconnect(peerInfo) } // New to protocol support diff --git a/src/topology/tests/multicodec-topology.js b/src/topology/tests/multicodec-topology.js index bfb12f6..4bef46c 100644 --- a/src/topology/tests/multicodec-topology.js +++ b/src/topology/tests/multicodec-topology.js @@ -86,6 +86,7 @@ module.exports = (test) => { expect(topology.peers.size).to.eql(1) expect(topology._onDisconnect.callCount).to.equal(1) + expect(topology._onDisconnect.calledWith(peer2)).to.equal(true) }) }) }