mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-25 21:22:15 +00:00
fix: multicodec topology disconnect with peer param (#12)
This commit is contained in:
parent
3f6c1cbee1
commit
d5dd256a21
@ -77,9 +77,7 @@ class MulticodecTopology extends Topology {
|
|||||||
|
|
||||||
// Not supporting the protocol anymore?
|
// Not supporting the protocol anymore?
|
||||||
if (existingPeer && hasProtocol.length === 0) {
|
if (existingPeer && hasProtocol.length === 0) {
|
||||||
this._onDisconnect({
|
this._onDisconnect(peerInfo)
|
||||||
peerInfo
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// New to protocol support
|
// New to protocol support
|
||||||
|
@ -86,6 +86,7 @@ module.exports = (test) => {
|
|||||||
|
|
||||||
expect(topology.peers.size).to.eql(1)
|
expect(topology.peers.size).to.eql(1)
|
||||||
expect(topology._onDisconnect.callCount).to.equal(1)
|
expect(topology._onDisconnect.callCount).to.equal(1)
|
||||||
|
expect(topology._onDisconnect.calledWith(peer2)).to.equal(true)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user