Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

Commit

Permalink
chore: update multiaddrs module
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Sep 11, 2019
1 parent fadc601 commit 0288da1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -77,7 +77,7 @@
"ky": "^0.13.0",
"ky-universal": "^0.3.0",
"lru-cache": "^5.1.1",
"multiaddr": "^6.0.6",
"multiaddr": "^7.1.0",
"multibase": "~0.6.0",
"multicodec": "~0.5.1",
"multihashes": "~0.4.14",
Expand Down
18 changes: 9 additions & 9 deletions test/constructor.spec.js
Expand Up @@ -24,15 +24,15 @@ describe('ipfs-http-client constructor tests', () => {

it('opts', () => {
const host = 'wizard.world'
const port = '999'
const port = 999
const protocol = 'https'
const ipfs = ipfsClient({ host, port, protocol })
expectConfig(ipfs, { host, port, protocol })
})

it('multiaddr dns4 string (implicit http)', () => {
const host = 'foo.com'
const port = '1001'
const port = 1001
const protocol = 'http' // default to http if not specified in multiaddr
const addr = `/dns4/${host}/tcp/${port}`
const ipfs = ipfsClient(addr)
Expand All @@ -41,7 +41,7 @@ describe('ipfs-http-client constructor tests', () => {

it('multiaddr dns4 string (explicit https)', () => {
const host = 'foo.com'
const port = '1001'
const port = 1001
const protocol = 'https'
const addr = `/dns4/${host}/tcp/${port}/${protocol}`
const ipfs = ipfsClient(addr)
Expand All @@ -50,7 +50,7 @@ describe('ipfs-http-client constructor tests', () => {

it('multiaddr dns4 string, explicit https in opts', () => {
const host = 'foo.com'
const port = '1001'
const port = 1001
const protocol = 'https'
const addr = `/dns4/${host}/tcp/${port}`
const ipfs = ipfsClient(addr, { protocol })
Expand All @@ -59,7 +59,7 @@ describe('ipfs-http-client constructor tests', () => {

it('multiaddr ipv4 string (implicit http)', () => {
const host = '101.101.101.101'
const port = '1001'
const port = 1001
const protocol = 'http'
const addr = `/ip4/${host}/tcp/${port}`
const ipfs = ipfsClient(addr)
Expand All @@ -68,7 +68,7 @@ describe('ipfs-http-client constructor tests', () => {

it('multiaddr ipv4 string (explicit https)', () => {
const host = '101.101.101.101'
const port = '1001'
const port = 1001
const protocol = 'https'
const addr = `/ip4/${host}/tcp/${port}/${protocol}`
const ipfs = ipfsClient(addr)
Expand All @@ -77,22 +77,22 @@ describe('ipfs-http-client constructor tests', () => {

it('multiaddr instance', () => {
const host = 'ace.place'
const port = '1001'
const port = 1001
const addr = multiaddr(`/dns4/${host}/tcp/${port}`)
const ipfs = ipfsClient(addr)
expectConfig(ipfs, { host, port })
})

it('host and port strings', () => {
const host = '1.1.1.1'
const port = '9999'
const port = 9999
const ipfs = ipfsClient(host, port)
expectConfig(ipfs, { host, port })
})

it('host, port and api path', () => {
const host = '10.100.100.255'
const port = '9999'
const port = 9999
const apiPath = '/future/api/v1/'
const ipfs = ipfsClient(host, port, { 'api-path': apiPath })
expectConfig(ipfs, { host, port, apiPath })
Expand Down
2 changes: 1 addition & 1 deletion test/node/swarm.js
Expand Up @@ -48,7 +48,7 @@ describe('.swarm.peers', function () {
expect(res).to.be.a('array')
expect(res.length).to.equal(1)
expect(res[0].error).to.not.exist()
expect(res[0].addr.toString()).to.equal('/ip4/73.109.217.59/tcp/49311/ipfs/QmWjxEGC7BthJrCf7QTModrcsRweHbupdPTY4oGMVoDZXm')
expect(res[0].addr.toString()).to.equal('/ip4/73.109.217.59/tcp/49311/p2p/QmWjxEGC7BthJrCf7QTModrcsRweHbupdPTY4oGMVoDZXm')
expect(res[0].peer.toB58String()).to.equal('QmWjxEGC7BthJrCf7QTModrcsRweHbupdPTY4oGMVoDZXm')
expect(scope.isDone()).to.equal(true)
})
Expand Down

0 comments on commit 0288da1

Please sign in to comment.