Skip to content
This repository was archived by the owner on Aug 23, 2019. It is now read-only.

Commit

Permalink
feat: update to latest deps and apis
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Jul 8, 2017
1 parent 2a9b170 commit 75646ac
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 32 deletions.
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,25 @@
},
"homepage": "https://github.com/libp2p/js-libp2p-ping",
"devDependencies": {
"aegir": "^11.0.0",
"async": "^2.1.5",
"chai": "^3.5.0",
"debug": "^2.6.3",
"dirty-chai": "^1.2.2",
"aegir": "^11.0.2",
"async": "^2.5.0",
"chai": "^4.0.2",
"debug": "^2.6.8",
"dirty-chai": "^2.0.0",
"gulp": "^3.9.1",
"libp2p-swarm": "~0.26.19",
"libp2p-tcp": "~0.9.4",
"multiaddr": "^2.2.2",
"peer-id": "~0.8.4",
"peer-info": "~0.8.4",
"libp2p-swarm": "~0.29.1",
"libp2p-tcp": "~0.10.1",
"multiaddr": "^2.3.0",
"peer-book": "^0.4.0",
"peer-id": "~0.8.7",
"peer-info": "~0.9.2",
"pre-commit": "^1.2.2",
"run-parallel": "^1.1.6"
},
"dependencies": {
"libp2p-crypto": "~0.8.7",
"libp2p-crypto": "~0.8.8",
"pull-handshake": "^1.1.4",
"pull-stream": "^3.5.0"
"pull-stream": "^3.6.0"
},
"contributors": [
"David Dias <daviddias.p@gmail.com>",
Expand All @@ -56,4 +57,4 @@
"Richard Littauer <richard.littauer@gmail.com>",
"greenkeeperio-bot <support@greenkeeper.io>"
]
}
}
35 changes: 16 additions & 19 deletions test/test-ping.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const PeerInfo = require('peer-info')
const PeerBook = require('peer-book')

const Swarm = require('libp2p-swarm')
const TCP = require('libp2p-tcp')
const multiaddr = require('multiaddr')
const series = require('async/series')
const parallel = require('async/parallel')

Expand All @@ -22,25 +23,21 @@ describe('libp2p ping', () => {

before((done) => {
series([
(cb) => PeerInfo.create((err, peerInfo) => {
expect(err).to.not.exist()
peerA = peerInfo
peerA.multiaddrs.add('/ip4/127.0.0.1/tcp/0')
cb()
}),
(cb) => PeerInfo.create((err, peerInfo) => {
expect(err).to.not.exist()
peerB = peerInfo
peerB.multiaddrs.add('/ip4/127.0.0.1/tcp/0')
cb()
}),
(cb) => {
PeerInfo.create((err, peerInfo) => {
expect(err).to.not.exist()
peerA = peerInfo
peerA.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/0'))
cb()
})
},
(cb) => {
PeerInfo.create((err, peerInfo) => {
expect(err).to.not.exist()
peerB = peerInfo
peerB.multiaddr.add(multiaddr('/ip4/127.0.0.1/tcp/0'))
cb()
})
},
(cb) => {
swarmA = new Swarm(peerA)
swarmB = new Swarm(peerB)
swarmA = new Swarm(peerA, new PeerBook())
swarmB = new Swarm(peerB, new PeerBook())
swarmA.transport.add('tcp', new TCP())
swarmB.transport.add('tcp', new TCP())
cb()
Expand Down

0 comments on commit 75646ac

Please sign in to comment.