Skip to content

Commit

Permalink
refactor: update secio and tests to use it (#484)
Browse files Browse the repository at this point in the history
* refactor: use async secio

* test: add secio to most test suites

* chore: update secio version
  • Loading branch information
jacobheun committed Jan 24, 2020
1 parent 2104578 commit f28b09f
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const WebSockets = require('libp2p-websockets')
const Muxer = require('libp2p-mplex')
const Crypto = require('./src/insecure/plaintext')
const Crypto = require('libp2p-secio')
const pipe = require('it-pipe')
let libp2p

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"libp2p-mdns": "^0.12.3",
"libp2p-mplex": "^0.9.1",
"libp2p-pnet": "~0.1.0",
"libp2p-secio": "^0.11.1",
"libp2p-secio": "^0.12.1",
"libp2p-spdy": "^0.13.2",
"libp2p-tcp": "^0.14.1",
"libp2p-websockets": "^0.13.1",
Expand Down
2 changes: 1 addition & 1 deletion src/transport-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class TransportManager {
try {
return await transport.dial(ma, options)
} catch (err) {
throw errCode(new Error('Transport dial failed'), codes.ERR_TRANSPORT_DIAL_FAILED, err)
throw errCode(err, codes.ERR_TRANSPORT_DIAL_FAILED)
}
}

Expand Down
2 changes: 1 addition & 1 deletion test/dialing/direct.node.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { expect } = chai
const sinon = require('sinon')
const Transport = require('libp2p-tcp')
const Muxer = require('libp2p-mplex')
const Crypto = require('../../src/insecure/plaintext')
const Crypto = require('libp2p-secio')
const multiaddr = require('multiaddr')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
Expand Down
2 changes: 1 addition & 1 deletion test/dialing/direct.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const pDefer = require('p-defer')
const delay = require('delay')
const Transport = require('libp2p-websockets')
const Muxer = require('libp2p-mplex')
const Crypto = require('../../src/insecure/plaintext')
const Crypto = require('libp2p-secio')
const multiaddr = require('multiaddr')
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
Expand Down
2 changes: 1 addition & 1 deletion test/upgrading/upgrader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const pipe = require('it-pipe')
const { collect } = require('streaming-iterables')
const pSettle = require('p-settle')
const Transport = require('libp2p-websockets')
const Crypto = require('../../src/insecure/plaintext')
const Crypto = require('libp2p-secio')
const Protector = require('../../src/pnet')
const swarmKeyBuffer = Buffer.from(require('../fixtures/swarm.key'))

Expand Down
2 changes: 1 addition & 1 deletion test/utils/base-options.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const Transport = require('libp2p-websockets')
const Muxer = require('libp2p-mplex')
const Crypto = require('../../src/insecure/plaintext')
const Crypto = require('libp2p-secio')

module.exports = {
modules: {
Expand Down
2 changes: 1 addition & 1 deletion test/utils/base-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const Transport = require('libp2p-tcp')
const Muxer = require('libp2p-mplex')
const Crypto = require('../../src/insecure/plaintext')
const Crypto = require('libp2p-secio')

module.exports = {
modules: {
Expand Down

0 comments on commit f28b09f

Please sign in to comment.