Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
deps: update @multiformats/multiaddr to 11.0.0 (#288)
Browse files Browse the repository at this point in the history
Updates all use of @multiformats/multiaddr
  • Loading branch information
achingbrain authored Sep 21, 2022
1 parent 339ad08 commit 57b2ad8
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/interface-address-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
},
"dependencies": {
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^10.2.0"
"@multiformats/multiaddr": "^11.0.0"
},
"devDependencies": {
"aegir": "^37.4.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
"@libp2p/interface-connection-encrypter": "^2.0.0",
"@libp2p/interface-peer-id": "^1.0.0",
"@libp2p/peer-id-factory": "^1.0.12",
"@multiformats/multiaddr": "^10.2.0",
"@multiformats/multiaddr": "^11.0.0",
"aegir": "^37.4.0",
"it-all": "^1.0.6",
"it-pair": "^2.0.2",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { duplexPair } from 'it-pair/duplex'
import { Multiaddr } from '@multiformats/multiaddr'
import { multiaddr } from '@multiformats/multiaddr'
import type { MultiaddrConnection } from '@libp2p/interface-connection'
import type { Duplex } from 'it-stream-types'

Expand All @@ -10,7 +10,7 @@ export function createMaConnPair (): [MultiaddrConnection, MultiaddrConnection]
const output: MultiaddrConnection = {
...duplex,
close: async () => {},
remoteAddr: new Multiaddr('/ip4/127.0.0.1/tcp/4001'),
remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4001'),
timeline: {
open: Date.now()
}
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-connection-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interface-peer-id": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^10.2.0"
"@multiformats/multiaddr": "^11.0.0"
},
"devDependencies": {
"aegir": "^37.4.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-connection/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"dependencies": {
"@libp2p/interface-peer-id": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^10.2.0",
"@multiformats/multiaddr": "^11.0.0",
"it-stream-types": "^1.0.4",
"uint8arraylist": "^2.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-mocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
"@libp2p/multistream-select": "^3.0.0",
"@libp2p/peer-id": "^1.1.12",
"@libp2p/peer-id-factory": "^1.0.12",
"@multiformats/multiaddr": "^10.2.0",
"@multiformats/multiaddr": "^11.0.0",
"abortable-iterator": "^4.0.2",
"any-signal": "^3.0.1",
"err-code": "^3.0.1",
Expand Down
10 changes: 5 additions & 5 deletions packages/interface-mocks/src/connection-encrypter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { handshake } from 'it-handshake'
import { duplexPair } from 'it-pair/duplex'
import { pipe } from 'it-pipe'
import { UnexpectedPeerError } from '@libp2p/interface-connection-encrypter/errors'
import { Multiaddr } from '@multiformats/multiaddr'
import { multiaddr } from '@multiformats/multiaddr'
import type { ConnectionEncrypter } from '@libp2p/interface-connection-encrypter'
import type { Transform, Source } from 'it-stream-types'
import map from 'it-map'
Expand Down Expand Up @@ -55,8 +55,8 @@ export function mockConnectionEncrypter () {
conn: {
...wrapper[1],
close: async () => {},
localAddr: new Multiaddr('/ip4/127.0.0.1/tcp/4001'),
remoteAddr: new Multiaddr('/ip4/127.0.0.1/tcp/4002'),
localAddr: multiaddr('/ip4/127.0.0.1/tcp/4001'),
remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'),
timeline: {
open: Date.now()
},
Expand Down Expand Up @@ -96,8 +96,8 @@ export function mockConnectionEncrypter () {
conn: {
...wrapper[1],
close: async () => {},
localAddr: new Multiaddr('/ip4/127.0.0.1/tcp/4001'),
remoteAddr: new Multiaddr('/ip4/127.0.0.1/tcp/4002'),
localAddr: multiaddr('/ip4/127.0.0.1/tcp/4001'),
remoteAddr: multiaddr('/ip4/127.0.0.1/tcp/4002'),
timeline: {
open: Date.now()
},
Expand Down
5 changes: 3 additions & 2 deletions packages/interface-mocks/src/multiaddr-connection.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { Multiaddr } from '@multiformats/multiaddr'
import { multiaddr } from '@multiformats/multiaddr'
import { duplexPair } from 'it-pair/duplex'
import { abortableSource } from 'abortable-iterator'
import type { MultiaddrConnection } from '@libp2p/interface-connection'
import type { Duplex } from 'it-stream-types'
import type { PeerId } from '@libp2p/interface-peer-id'
import type { Multiaddr } from '@multiformats/multiaddr'

export function mockMultiaddrConnection (source: Duplex<Uint8Array> & Partial<MultiaddrConnection>, peerId: PeerId): MultiaddrConnection {
const maConn: MultiaddrConnection = {
Expand All @@ -13,7 +14,7 @@ export function mockMultiaddrConnection (source: Duplex<Uint8Array> & Partial<Mu
timeline: {
open: Date.now()
},
remoteAddr: new Multiaddr(`/ip4/127.0.0.1/tcp/4001/p2p/${peerId.toString()}`),
remoteAddr: multiaddr(`/ip4/127.0.0.1/tcp/4001/p2p/${peerId.toString()}`),
...source
}

Expand Down
4 changes: 2 additions & 2 deletions packages/interface-mocks/src/peer-discovery.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Multiaddr } from '@multiformats/multiaddr'
import { multiaddr } from '@multiformats/multiaddr'
import * as PeerIdFactory from '@libp2p/peer-id-factory'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interface-peer-discovery'
Expand Down Expand Up @@ -55,7 +55,7 @@ export class MockDiscovery extends EventEmitter<PeerDiscoveryEvents> implements
this.dispatchEvent(new CustomEvent<PeerInfo>('peer', {
detail: {
id: peerId,
multiaddrs: [new Multiaddr('/ip4/127.0.0.1/tcp/8000')],
multiaddrs: [multiaddr('/ip4/127.0.0.1/tcp/8000')],
protocols: []
}
}))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"@libp2p/interface-compliance-tests": "^3.0.0",
"@libp2p/interface-peer-discovery": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^10.2.0",
"@multiformats/multiaddr": "^11.0.0",
"aegir": "^37.4.0",
"delay": "^5.0.0",
"p-defer": "^4.0.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { expect } from 'aegir/chai'
import { Multiaddr } from '@multiformats/multiaddr'
import { isMultiaddr } from '@multiformats/multiaddr'
import delay from 'delay'
import pDefer from 'p-defer'
import { start, stop } from '@libp2p/interfaces/startable'
Expand Down Expand Up @@ -50,7 +50,7 @@ export default (common: TestSetup<PeerDiscovery & Startable>) => {
expect(id).to.have.property('type').that.is.oneOf(['RSA', 'Ed25519', 'secp256k1'])
expect(multiaddrs).to.exist()

multiaddrs.forEach((m) => expect(Multiaddr.isMultiaddr(m)).to.eql(true))
multiaddrs.forEach((m) => expect(isMultiaddr(m)).to.eql(true))

defer.resolve()
})
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-peer-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
},
"dependencies": {
"@libp2p/interface-peer-id": "^1.0.0",
"@multiformats/multiaddr": "^10.2.0"
"@multiformats/multiaddr": "^11.0.0"
},
"devDependencies": {
"aegir": "^37.4.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-transport-compliance-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
"@libp2p/interface-registrar": "^2.0.0",
"@libp2p/interface-transport": "^1.0.0",
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^10.2.0",
"@multiformats/multiaddr": "^11.0.0",
"aegir": "^37.4.0",
"it-all": "^1.0.6",
"it-drain": "^1.0.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/interface-transport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
"dependencies": {
"@libp2p/interface-connection": "^3.0.0",
"@libp2p/interfaces": "^3.0.0",
"@multiformats/multiaddr": "^10.2.0",
"@multiformats/multiaddr": "^11.0.0",
"it-stream-types": "^1.0.4"
},
"devDependencies": {
Expand Down

0 comments on commit 57b2ad8

Please sign in to comment.