Skip to content

Commit

Permalink
rm laf
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Sep 23, 2015
1 parent 5b7a605 commit 1ba8e80
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 34 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"scripts": {
"test": "./node_modules/.bin/lab tests/*-test.js",
"coverage": "./node_modules/.bin/lab -t 88 tests/*-test.js",
"laf": "./node_modules/.bin/standard --format",
"lint": "./node_modules/.bin/standard"
},
"repository": {
Expand Down
16 changes: 8 additions & 8 deletions src/identify/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@ function identify (muxedConns, peerInfoSelf, socket, conn, muxer) {
socket: socket
}

// TODO: Pass the new discovered info about the peer that contacted us
// to something like the Kademlia Router, so the peerInfo for this peer
// is fresh
// - before this was exectued through a event emitter
// self.emit('peer-update', {
// peerId: peerId,
// listenAddrs: msg.listenAddrs.map(function (mhb) {return multiaddr(mhb)})
// })
// TODO: Pass the new discovered info about the peer that contacted us
// to something like the Kademlia Router, so the peerInfo for this peer
// is fresh
// - before this was exectued through a event emitter
// self.emit('peer-update', {
// peerId: peerId,
// listenAddrs: msg.listenAddrs.map(function (mhb) {return multiaddr(mhb)})
// })
})

var mh = getMultiaddr(socket)
Expand Down
8 changes: 3 additions & 5 deletions src/swarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,7 @@ function Swarm (peerInfo) {
})
}

self.addUpgrade = function (ConnUpgrade, options) {

}
self.addUpgrade = function (ConnUpgrade, options) {}

self.addStreamMuxer = function (name, StreamMuxer, options) {
self.muxers[name] = {
Expand Down Expand Up @@ -260,7 +258,7 @@ function Swarm (peerInfo) {
// we pass muxedConns so that identify can access the socket of the other
// peer
self.handleProtocol(identify.protoId,
identify.getHandlerFunction(self.peerInfo, self.muxedConns))
identify.getHandlerFunction(self.peerInfo, self.muxedConns))
}

self.handleProtocol = function (protocol, handlerFunction) {
Expand Down Expand Up @@ -299,7 +297,7 @@ function Swarm (peerInfo) {
muxer.on('stream', userProtocolMuxer)
})
} else {
// if no stream muxer, then
// if no stream muxer, then
userProtocolMuxer(conn)
}
}
Expand Down
40 changes: 20 additions & 20 deletions tests/swarm-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ experiment('Without a Stream Muxer', function () {
var sw = new Swarm(p)

sw.addTransport('tcp', tcp,
{ multiaddr: mh }, {}, {port: 8010}, function () {
expect(sw.transports['tcp'].options).to.deep.equal({ multiaddr: mh })
expect(sw.transports['tcp'].dialOptions).to.deep.equal({})
expect(sw.transports['tcp'].listenOptions).to.deep.equal({port: 8010})
expect(sw.transports['tcp'].transport).to.deep.equal(tcp)
sw.closeListener('tcp', function () {
done()
{ multiaddr: mh }, {}, {port: 8010}, function () {
expect(sw.transports['tcp'].options).to.deep.equal({ multiaddr: mh })
expect(sw.transports['tcp'].dialOptions).to.deep.equal({})
expect(sw.transports['tcp'].listenOptions).to.deep.equal({port: 8010})
expect(sw.transports['tcp'].transport).to.deep.equal(tcp)
sw.closeListener('tcp', function () {
done()
})
})
})
})

test('dial a conn', function (done) {
Expand Down Expand Up @@ -185,9 +185,9 @@ experiment('Without a Stream Muxer', function () {
}
})

// test('add an upgrade', function (done) { done() })
// test('dial a conn on top of a upgrade', function (done) { done() })
// test('dial a conn on a protocol on top of a upgrade', function (done) { done() })
// test('add an upgrade', function (done) { done() })
// test('dial a conn on top of a upgrade', function (done) { done() })
// test('dial a conn on a protocol on top of a upgrade', function (done) { done() })
})

/* TODO
Expand All @@ -210,15 +210,15 @@ experiment('Without a Stream Muxer', function () {
test('dial a conn on a protocol on top of a upgrade', function (done) { done() })
}) */

/* TODO
experiment('utp', function () {
test('add the transport', function (done) { done() })
test('dial a conn', function (done) { done() })
test('dial a conn on a protocol', function (done) { done() })
test('add an upgrade', function (done) { done() })
test('dial a conn on top of a upgrade', function (done) { done() })
test('dial a conn on a protocol on top of a upgrade', function (done) { done() })
}) */
/* TODO
experiment('utp', function () {
test('add the transport', function (done) { done() })
test('dial a conn', function (done) { done() })
test('dial a conn on a protocol', function (done) { done() })
test('add an upgrade', function (done) { done() })
test('dial a conn on top of a upgrade', function (done) { done() })
test('dial a conn on a protocol on top of a upgrade', function (done) { done() })
}) */
})

experiment('With a SPDY Stream Muxer', function () {
Expand Down

0 comments on commit 1ba8e80

Please sign in to comment.