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

Commit

Permalink
chore: update aegir
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Mar 21, 2017
1 parent 8bdf61c commit d5668d1
Show file tree
Hide file tree
Showing 16 changed files with 134 additions and 93 deletions.
33 changes: 17 additions & 16 deletions package.json
Expand Up @@ -40,34 +40,35 @@
"npm": ">=3.0.0"
},
"devDependencies": {
"aegir": "^10.0.0",
"aegir": "^11.0.0",
"buffer-loader": "0.0.1",
"chai": "^3.5.0",
"dirty-chai": "^1.2.2",
"gulp": "^3.9.1",
"libp2p-multiplex": "~0.4.0",
"libp2p-secio": "~0.6.7",
"libp2p-spdy": "~0.10.4",
"libp2p-tcp": "~0.9.3",
"libp2p-webrtc-star": "~0.8.7",
"libp2p-websockets": "~0.9.2",
"libp2p-multiplex": "~0.4.3",
"libp2p-secio": "~0.6.8",
"libp2p-spdy": "~0.10.6",
"libp2p-tcp": "~0.9.4",
"libp2p-webrtc-star": "~0.8.10",
"libp2p-websockets": "~0.9.4",
"pre-commit": "^1.2.2",
"pull-goodbye": "0.0.1",
"pull-stream": "^3.5.0",
"webrtcsupport": "^2.2.0"
},
"dependencies": {
"async": "^2.1.4",
"async": "^2.1.5",
"browserify-zlib-next": "^1.0.1",
"debug": "^2.6.1",
"interface-connection": "~0.3.1",
"debug": "^2.6.3",
"interface-connection": "~0.3.2",
"ip-address": "^5.8.6",
"libp2p-identify": "~0.3.2",
"libp2p-identify": "~0.3.3",
"lodash.includes": "^4.3.0",
"multiaddr": "^2.2.1",
"multistream-select": "~0.13.4",
"multiaddr": "^2.2.2",
"multistream-select": "~0.13.5",
"once": "^1.4.0",
"peer-id": "~0.8.2",
"peer-info": "~0.8.3",
"peer-id": "~0.8.4",
"peer-info": "~0.8.4",
"protocol-buffers": "^3.2.1"
},
"contributors": [
Expand All @@ -85,4 +86,4 @@
"greenkeeper[bot] <greenkeeper[bot]@users.noreply.github.com>",
"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ <victorbjelkholm@gmail.com>"
]
}
}
5 changes: 4 additions & 1 deletion test/00-instance.node.js
@@ -1,7 +1,10 @@
/* eslint-env mocha */
'use strict'

const expect = require('chai').expect
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const Swarm = require('../src')

Expand Down
11 changes: 7 additions & 4 deletions test/01-transport-tcp.node.js
@@ -1,7 +1,10 @@
/* eslint-env mocha */
'use strict'

const expect = require('chai').expect
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const parallel = require('async/parallel')
const multiaddr = require('multiaddr')
const Peer = require('peer-info')
Expand Down Expand Up @@ -84,7 +87,7 @@ describe('transport - tcp', function () {

it('dial to a multiaddr', (done) => {
const conn = swarmA.transport.dial('tcp', multiaddr('/ip4/127.0.0.1/tcp/9999'), (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
})

pull(
Expand All @@ -101,7 +104,7 @@ describe('transport - tcp', function () {
multiaddr('/ip4/127.0.0.1/tcp/9999'),
multiaddr('/ip4/127.0.0.1/tcp/9309')
], (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
})

pull(
Expand Down Expand Up @@ -204,7 +207,7 @@ describe('transport - tcp', function () {
})

function ready (err) {
expect(err).to.exist
expect(err).to.exist()
expect(err.code).to.equal('EADDRINUSE')
swarm1.close(() => swarm2.close(done))
}
Expand Down
5 changes: 1 addition & 4 deletions test/02-transport-utp.node.js
@@ -1,11 +1,8 @@
/* eslint-env mocha */
'use strict'

describe('transport - utp', function () {
this.timeout(10000)

describe('transport - utp', () => {
before((done) => { done() })

it.skip('add', (done) => {})
it.skip('listen', (done) => {})
it.skip('dial', (done) => {})
Expand Down
14 changes: 8 additions & 6 deletions test/03-transport-websockets.node.js
@@ -1,8 +1,10 @@
/* eslint-env mocha */
'use strict'

const expect = require('chai').expect

const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)
const parallel = require('async/parallel')
const multiaddr = require('multiaddr')
const WebSockets = require('libp2p-websockets')
Expand Down Expand Up @@ -70,13 +72,13 @@ describe('transport - websockets', function () {

it('dial', (done) => {
const conn = swarmA.transport.dial('ws', multiaddr('/ip4/127.0.0.1/tcp/9999/ws'), (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
})

const s = goodbye({
source: pull.values([Buffer('hey')]),
sink: pull.collect((err, data) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(data).to.be.eql([Buffer('hey')])
done()
})
Expand All @@ -86,12 +88,12 @@ describe('transport - websockets', function () {

it('dial (conn from callback)', (done) => {
swarmA.transport.dial('ws', multiaddr('/ip4/127.0.0.1/tcp/9999/ws'), (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()

const s = goodbye({
source: pull.values([Buffer('hey')]),
sink: pull.collect((err, data) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(data).to.be.eql([Buffer('hey')])
done()
})
Expand Down
15 changes: 9 additions & 6 deletions test/04-muxing-multiplex.node.js
@@ -1,7 +1,10 @@
/* eslint-env mocha */
'use strict'

const expect = require('chai').expect
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const parallel = require('async/parallel')
const multiaddr = require('multiaddr')
Expand Down Expand Up @@ -71,7 +74,7 @@ describe('stream muxing with multiplex (on TCP)', () => {
})

swarmA.dial(peerB, '/abacaxi/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmA.muxedConns).length).to.equal(1)
pull(
pull.empty(),
Expand All @@ -83,7 +86,7 @@ describe('stream muxing with multiplex (on TCP)', () => {

it('dial to warm conn', (done) => {
swarmB.dial(peerA, (err) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmB.conns).length).to.equal(0)
expect(Object.keys(swarmB.muxedConns).length).to.equal(1)
done()
Expand All @@ -96,7 +99,7 @@ describe('stream muxing with multiplex (on TCP)', () => {
})

swarmB.dial(peerA, '/papaia/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmB.conns).length).to.equal(0)
expect(Object.keys(swarmB.muxedConns).length).to.equal(1)
pull(
Expand All @@ -112,7 +115,7 @@ describe('stream muxing with multiplex (on TCP)', () => {
swarmC.connection.reuse()

swarmC.dial(peerA, (err) => {
expect(err).to.not.exist
expect(err).to.not.exist()
setTimeout(() => {
expect(Object.keys(swarmC.muxedConns).length).to.equal(1)
expect(Object.keys(swarmA.muxedConns).length).to.equal(2)
Expand All @@ -123,7 +126,7 @@ describe('stream muxing with multiplex (on TCP)', () => {

it('closing one side cleans out in the other', (done) => {
swarmC.close((err) => {
expect(err).to.not.exist
expect(err).to.not.exist()
setTimeout(() => {
expect(Object.keys(swarmA.muxedConns).length).to.equal(1)
done()
Expand Down
23 changes: 13 additions & 10 deletions test/05-muxing-spdy.node.js
@@ -1,7 +1,10 @@
/* eslint-env mocha */
'use strict'

const expect = require('chai').expect
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const parallel = require('async/parallel')
const multiaddr = require('multiaddr')
Expand Down Expand Up @@ -85,15 +88,15 @@ describe('stream muxing with spdy (on TCP)', () => {
})

swarmA.dial(peerB, '/abacaxi/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmA.muxedConns).length).to.equal(1)
pull(pull.empty(), conn, pull.onEnd(done))
})
})

it('dial to warm conn', (done) => {
swarmB.dial(peerA, (err) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmB.conns).length).to.equal(0)
expect(Object.keys(swarmB.muxedConns).length).to.equal(1)
done()
Expand All @@ -106,7 +109,7 @@ describe('stream muxing with spdy (on TCP)', () => {
})

swarmB.dial(peerA, '/papaia/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmB.conns).length).to.equal(0)
expect(Object.keys(swarmB.muxedConns).length).to.equal(1)
pull(pull.empty(), conn, pull.onEnd(done))
Expand All @@ -118,7 +121,7 @@ describe('stream muxing with spdy (on TCP)', () => {
swarmC.connection.reuse()

swarmC.dial(peerA, (err) => {
expect(err).to.not.exist
expect(err).to.not.exist()
setTimeout(() => {
expect(Object.keys(swarmC.muxedConns).length).to.equal(1)
expect(Object.keys(swarmA.muxedConns).length).to.equal(2)
Expand All @@ -130,20 +133,20 @@ describe('stream muxing with spdy (on TCP)', () => {
it('with Identify, do getPeerInfo', (done) => {
swarmA.handle('/banana/1.0.0', (protocol, conn) => {
conn.getPeerInfo((err, peerInfoC) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(peerInfoC.id.toB58String()).to.equal(peerC.id.toB58String())
})

pull(conn, conn)
})

swarmC.dial(peerA, '/banana/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
setTimeout(() => {
expect(Object.keys(swarmC.muxedConns).length).to.equal(1)
expect(Object.keys(swarmA.muxedConns).length).to.equal(2)
conn.getPeerInfo((err, peerInfoA) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(peerInfoA.id.toB58String()).to.equal(peerA.id.toB58String())
pull(pull.empty(), conn, pull.onEnd(done))
})
Expand All @@ -168,7 +171,7 @@ describe('stream muxing with spdy (on TCP)', () => {
})

swarmA.dial(peerD, '/banana/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()

pull(
pull.empty(),
Expand Down Expand Up @@ -221,7 +224,7 @@ describe('stream muxing with spdy (on TCP)', () => {
})

swarmF.dial(peerE, '/avocado/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
pull(conn, pull.onEnd(destroyed))
pull(
pull.empty(),
Expand Down
13 changes: 8 additions & 5 deletions test/06-conn-upgrade-secio.node.js
@@ -1,7 +1,10 @@
/* eslint-env mocha */
'use strict'

const expect = require('chai').expect
const chai = require('chai')
const dirtyChai = require('dirty-chai')
const expect = chai.expect
chai.use(dirtyChai)

const parallel = require('async/parallel')
const multiaddr = require('multiaddr')
Expand Down Expand Up @@ -79,15 +82,15 @@ describe('secio conn upgrade (on TCP)', () => {
})

swarmA.dial(peerB, '/abacaxi/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmA.muxedConns).length).to.equal(1)
pull(pull.empty(), conn, pull.onEnd(done))
})
})

it('dial to warm conn', (done) => {
swarmB.dial(peerA, (err) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmB.conns).length).to.equal(0)
expect(Object.keys(swarmB.muxedConns).length).to.equal(1)
done()
Expand All @@ -100,7 +103,7 @@ describe('secio conn upgrade (on TCP)', () => {
})

swarmB.dial(peerA, '/papaia/1.0.0', (err, conn) => {
expect(err).to.not.exist
expect(err).to.not.exist()
expect(Object.keys(swarmB.conns).length).to.equal(0)
expect(Object.keys(swarmB.muxedConns).length).to.equal(1)
pull(pull.empty(), conn, pull.onEnd(done))
Expand All @@ -112,7 +115,7 @@ describe('secio conn upgrade (on TCP)', () => {
swarmC.connection.reuse()

swarmC.dial(peerA, (err) => {
expect(err).to.not.exist
expect(err).to.not.exist()
setTimeout(() => {
expect(Object.keys(swarmC.muxedConns).length).to.equal(1)
expect(Object.keys(swarmA.muxedConns).length).to.equal(2)
Expand Down

0 comments on commit d5668d1

Please sign in to comment.