From 1edde75ee9c37322b8e676468963db0ce88a823f Mon Sep 17 00:00:00 2001 From: achingbrain Date: Sat, 13 Jun 2020 12:12:00 +0100 Subject: [PATCH] fix: pass connection encryption module to libp2p Since the `v0.28.1` point release, libp2p now requires a connection enryption module to be passed in config, otherwise it throws. See: https://github.com/libp2p/js-libp2p/pull/665 --- packages/ipfs/test/core/libp2p.spec.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/ipfs/test/core/libp2p.spec.js b/packages/ipfs/test/core/libp2p.spec.js index dca715d01e..8161186d05 100644 --- a/packages/ipfs/test/core/libp2p.spec.js +++ b/packages/ipfs/test/core/libp2p.spec.js @@ -7,6 +7,7 @@ const PeerId = require('peer-id') const Libp2p = require('libp2p') const EE = require('events') const libp2pComponent = require('../../src/core/components/libp2p') +const Crypto = require('libp2p-secio') class DummyTransport { get [Symbol.toStringTag] () { @@ -32,7 +33,7 @@ class DummyDiscovery extends EE { } } -describe('libp2p customization', function () { +describe.only('libp2p customization', function () { // Provide some extra time for ci since we're starting libp2p nodes in each test this.timeout(25 * 1000) @@ -77,7 +78,7 @@ describe('libp2p customization', function () { libp2p: (opts) => { return new Libp2p({ peerId: opts.peerId, - modules: { transport: [DummyTransport] }, + modules: { transport: [DummyTransport], connEncryption: [ Crypto ] }, config: { relay: { enabled: false } } }) } @@ -101,7 +102,7 @@ describe('libp2p customization', function () { libp2p: (opts) => { return new Libp2p({ peerId: opts.peerId, - modules: { transport: [DummyTransport] }, + modules: { transport: [DummyTransport], connEncryption: [ Crypto ] }, config: { relay: { enabled: false } } }) }