From d5dd256a213ed19a728f66f31dde4387c5baacd0 Mon Sep 17 00:00:00 2001 From: Vasco Santos Date: Mon, 2 Dec 2019 16:06:26 +0100 Subject: [PATCH] fix: multicodec topology disconnect with peer param (#12) --- src/topology/multicodec-topology.js | 4 +--- src/topology/tests/multicodec-topology.js | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) 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) }) }) }