Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
fix: disconnect by peerid not address (#577)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobheun authored and Alan Shaw committed Jan 7, 2020
1 parent c69e7f0 commit 1890faa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/swarm/disconnect.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
'use strict'

const { getDescribe, getIt, expect } = require('../utils/mocha')
const PeerId = require('peer-id')

/** @typedef { import("ipfsd-ctl/src/factory") } Factory */
/**
Expand Down Expand Up @@ -32,7 +33,7 @@ module.exports = (common, options) => {
peers = await ipfsA.swarm.peers()
expect(peers).to.have.length.above(0)

await ipfsA.swarm.disconnect(ipfsB.peerId.addresses[0])
await ipfsA.swarm.disconnect(PeerId.createFromCID(ipfsB.peerId.id))

peers = await ipfsA.swarm.peers()
expect(peers).to.have.length(0)
Expand Down

0 comments on commit 1890faa

Please sign in to comment.