fix: start and stop connection manager with libp2p

test: add test to verify libp2p starts and stops the right things
test: add test for verifying disabled modules
fix: linting
This commit is contained in:
Jacob Heun
2018-07-19 15:53:18 +02:00
committed by David Dias
parent d9059dbad9
commit 6106915923
5 changed files with 96 additions and 3 deletions

View File

@ -146,7 +146,10 @@ class Node extends EventEmitter {
})
series([
(cb) => this._switch.start(cb),
(cb) => {
this.connectionManager.start()
this._switch.start(cb)
},
(cb) => {
if (ws) {
// always add dialing on websockets
@ -256,7 +259,10 @@ class Node extends EventEmitter {
}
cb()
},
(cb) => this._switch.stop(cb),
(cb) => {
this.connectionManager.stop()
this._switch.stop(cb)
},
(cb) => {
this.emit('stop')
cb()