Skip to content

Commit 55727ee

Browse files
knownNodes -> nodes (#185)
* knownNodes -> nodes * Remove opts.debug * Remove `options.debug` tests
1 parent d8eab52 commit 55727ee

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ module.exports = class Hyperswarm extends EventEmitter {
3535

3636
this.dht = opts.dht || new DHT({
3737
bootstrap: opts.bootstrap,
38-
debug: opts.debug,
39-
knownNodes: opts.knownNodes
38+
nodes: opts.nodes
4039
})
4140
this.server = this.dht.createServer({
4241
firewall: this._handleFirewall.bind(this),

test/swarm.js

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -418,57 +418,6 @@ test('one server, one client - correct deduplication when a client connection is
418418
swarm2.join(topic, { server: false, client: true })
419419
})
420420

421-
test('constructor options - debug options forwarded to DHT constructor', async (t) => {
422-
const { bootstrap } = await createTestnet(3, t.teardown)
423-
424-
const swarm1 = new Hyperswarm({
425-
bootstrap,
426-
backoffs: BACKOFFS,
427-
jitter: 0,
428-
debug: {
429-
handshake: {
430-
latency: [500, 500]
431-
}
432-
}
433-
})
434-
const swarm2 = new Hyperswarm({
435-
bootstrap,
436-
backoffs: BACKOFFS,
437-
jitter: 0,
438-
debug: {
439-
handshake: {
440-
latency: [500, 500]
441-
}
442-
}
443-
})
444-
445-
const connected = t.test('connection')
446-
connected.plan(2)
447-
448-
swarm1.once('connection', (conn) => {
449-
connected.pass('swarm1')
450-
conn.on('error', noop)
451-
})
452-
swarm2.once('connection', (conn) => {
453-
connected.pass('swarm2')
454-
conn.on('error', noop)
455-
})
456-
457-
const topic = Buffer.alloc(32).fill('hello world')
458-
await swarm1.join(topic, { server: true }).flushed()
459-
460-
const start = Date.now()
461-
swarm2.join(topic, { client: true })
462-
463-
await connected
464-
465-
const duration = Date.now() - start
466-
t.ok(duration > 500)
467-
468-
await swarm1.destroy()
469-
await swarm2.destroy()
470-
})
471-
472421
test('flush when max connections reached', async (t) => {
473422
const { bootstrap } = await createTestnet(3, t.teardown)
474423

0 commit comments

Comments
 (0)