mirror of
https://github.com/fluencelabs/js-libp2p-interfaces
synced 2025-04-29 05:02:36 +00:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
96d4a118db | ||
|
d14c37d14b | ||
|
9340ec9d98 | ||
|
d9224d5409 |
@ -62,15 +62,15 @@
|
|||||||
"it-pair": "^1.0.0",
|
"it-pair": "^1.0.0",
|
||||||
"it-pipe": "^1.1.0",
|
"it-pipe": "^1.1.0",
|
||||||
"it-pushable": "^1.4.2",
|
"it-pushable": "^1.4.2",
|
||||||
"libp2p-crypto": "^0.19.0",
|
"libp2p-crypto": "fluencelabs/js-libp2p-crypto",
|
||||||
"libp2p-tcp": "^0.15.0",
|
"libp2p-tcp": "fluencelabs/js-libp2p-tcp",
|
||||||
"multiaddr": "^8.1.2",
|
"multiaddr": "^9.0.1",
|
||||||
"multibase": "^4.0.2",
|
"multibase": "^4.0.2",
|
||||||
"multihashes": "^4.0.2",
|
"multihashes": "^4.0.2",
|
||||||
"p-defer": "^3.0.0",
|
"p-defer": "^3.0.0",
|
||||||
"p-limit": "^3.1.0",
|
"p-limit": "^3.1.0",
|
||||||
"p-wait-for": "^3.2.0",
|
"p-wait-for": "^3.2.0",
|
||||||
"peer-id": "^0.14.2",
|
"peer-id": "fluencelabs/js-peer-id",
|
||||||
"protons": "^2.0.0",
|
"protons": "^2.0.0",
|
||||||
"sinon": "^10.0.0",
|
"sinon": "^10.0.0",
|
||||||
"streaming-iterables": "^5.0.4",
|
"streaming-iterables": "^5.0.4",
|
||||||
|
@ -240,7 +240,7 @@ module.exports = Connection
|
|||||||
* @param {{ direction: any; timeline: any; multiplexer?: string | undefined; encryption?: string | undefined; }} stat
|
* @param {{ direction: any; timeline: any; multiplexer?: string | undefined; encryption?: string | undefined; }} stat
|
||||||
*/
|
*/
|
||||||
function validateArgs (localAddr, localPeer, remotePeer, newStream, close, getStreams, stat) {
|
function validateArgs (localAddr, localPeer, remotePeer, newStream, close, getStreams, stat) {
|
||||||
if (localAddr && !multiaddr.isMultiaddr(localAddr)) {
|
if (localAddr && !multiaddr.Multiaddr.isMultiaddr(localAddr)) {
|
||||||
throw errCode(new Error('localAddr must be an instance of multiaddr'), 'ERR_INVALID_PARAMETERS')
|
throw errCode(new Error('localAddr must be an instance of multiaddr'), 'ERR_INVALID_PARAMETERS')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
src/content-routing/types.d.ts
vendored
2
src/content-routing/types.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
export = ContentRouting;
|
export = ContentRouting;
|
||||||
|
|
||||||
import PeerId from 'peer-id'
|
import PeerId from 'peer-id'
|
||||||
import Multiaddr from 'multiaddr'
|
import { Multiaddr } from 'multiaddr'
|
||||||
import CID from 'cids'
|
import CID from 'cids'
|
||||||
|
|
||||||
declare class ContentRouting {
|
declare class ContentRouting {
|
||||||
|
@ -55,7 +55,7 @@ module.exports = (common) => {
|
|||||||
expect(PeerId.isPeerId(id)).to.eql(true)
|
expect(PeerId.isPeerId(id)).to.eql(true)
|
||||||
expect(multiaddrs).to.exist()
|
expect(multiaddrs).to.exist()
|
||||||
|
|
||||||
multiaddrs.forEach((m) => expect(multiaddr.isMultiaddr(m)).to.eql(true))
|
multiaddrs.forEach((m) => expect(multiaddr.Multiaddr.isMultiaddr(m)).to.eql(true))
|
||||||
|
|
||||||
defer.resolve()
|
defer.resolve()
|
||||||
})
|
})
|
||||||
|
2
src/peer-routing/types.d.ts
vendored
2
src/peer-routing/types.d.ts
vendored
@ -1,7 +1,7 @@
|
|||||||
export = PeerRouting;
|
export = PeerRouting;
|
||||||
|
|
||||||
import PeerId from 'peer-id'
|
import PeerId from 'peer-id'
|
||||||
import Multiaddr from 'multiaddr'
|
import { Multiaddr } from 'multiaddr'
|
||||||
|
|
||||||
declare class PeerRouting {
|
declare class PeerRouting {
|
||||||
constructor (options?: Object);
|
constructor (options?: Object);
|
||||||
|
2
src/transport/types.d.ts
vendored
2
src/transport/types.d.ts
vendored
@ -1,6 +1,6 @@
|
|||||||
import BufferList from 'bl'
|
import BufferList from 'bl'
|
||||||
import events from 'events'
|
import events from 'events'
|
||||||
import Multiaddr from 'multiaddr'
|
import { Multiaddr } from 'multiaddr'
|
||||||
import Connection from '../connection/connection'
|
import Connection from '../connection/connection'
|
||||||
import { Sink } from '../stream-muxer/types'
|
import { Sink } from '../stream-muxer/types'
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@ describe('compliance tests', () => {
|
|||||||
* @param {*} properties
|
* @param {*} properties
|
||||||
*/
|
*/
|
||||||
async setup (properties) {
|
async setup (properties) {
|
||||||
const localAddr = multiaddr('/ip4/127.0.0.1/tcp/8080')
|
const localAddr = new multiaddr.Multiaddr('/ip4/127.0.0.1/tcp/8080')
|
||||||
const remoteAddr = multiaddr('/ip4/127.0.0.1/tcp/8081')
|
const remoteAddr = new multiaddr.Multiaddr('/ip4/127.0.0.1/tcp/8081')
|
||||||
const [localPeer, remotePeer] = await Promise.all([
|
const [localPeer, remotePeer] = await Promise.all([
|
||||||
PeerId.createFromJSON(peers[0]),
|
PeerId.createFromJSON(peers[0]),
|
||||||
PeerId.createFromJSON(peers[1])
|
PeerId.createFromJSON(peers[1])
|
||||||
|
@ -41,7 +41,7 @@ class MockDiscovery extends EventEmitter {
|
|||||||
this._timer = setTimeout(() => {
|
this._timer = setTimeout(() => {
|
||||||
this.emit('peer', {
|
this.emit('peer', {
|
||||||
id: peerId,
|
id: peerId,
|
||||||
multiaddrs: [multiaddr('/ip4/127.0.0.1/tcp/8000')]
|
multiaddrs: [new multiaddr.Multiaddr('/ip4/127.0.0.1/tcp/8000')]
|
||||||
})
|
})
|
||||||
}, this.options.discoveryDelay || 1000)
|
}, this.options.discoveryDelay || 1000)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user