Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: update secio and tests to use it #484

Merged
merged 3 commits into from
Nov 26, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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