From b0a74dab12fa30079fab5697ca037cf162987430 Mon Sep 17 00:00:00 2001 From: achingbrain Date: Wed, 4 May 2022 13:28:35 +0100 Subject: [PATCH] fix: update interfaces Update to the latest interface versions --- package.json | 4 ++-- src/compat/index.ts | 2 +- src/compat/querier.ts | 2 +- src/index.ts | 2 +- test/compat/go-multicast-dns.spec.ts | 2 +- test/compat/responder.spec.ts | 2 +- test/compliance.spec.ts | 3 ++- test/multicast-dns.spec.ts | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package.json b/package.json index 986eed6..30123d1 100644 --- a/package.json +++ b/package.json @@ -129,6 +129,7 @@ "release": "aegir release" }, "dependencies": { + "@libp2p/interfaces": "^1.3.31", "@libp2p/logger": "^1.1.3", "@libp2p/peer-id": "^1.1.9", "@multiformats/multiaddr": "^10.1.5", @@ -136,8 +137,7 @@ "multiformats": "^9.6.3" }, "devDependencies": { - "@libp2p/interface-compliance-tests": "^1.1.21", - "@libp2p/interfaces": "^1.3.20", + "@libp2p/interface-compliance-tests": "^1.1.32", "@libp2p/peer-id-factory": "^1.0.9", "@types/multicast-dns": "^7.2.1", "aegir": "^37.0.8", diff --git a/src/compat/index.ts b/src/compat/index.ts index ef2b7cc..57ffaa2 100644 --- a/src/compat/index.ts +++ b/src/compat/index.ts @@ -1,5 +1,5 @@ // Compatibility with Go libp2p MDNS -import { EventEmitter, CustomEvent } from '@libp2p/interfaces' +import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events' import { Responder } from './responder.js' import { Querier } from './querier.js' import type { PeerDiscovery, PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery' diff --git a/src/compat/querier.ts b/src/compat/querier.ts index 8bf3155..2f3ead3 100644 --- a/src/compat/querier.ts +++ b/src/compat/querier.ts @@ -1,4 +1,4 @@ -import { CustomEvent, EventEmitter } from '@libp2p/interfaces' +import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events' import MDNS from 'multicast-dns' import { logger } from '@libp2p/logger' import { SERVICE_TAG_LOCAL, MULTICAST_IP, MULTICAST_PORT } from './constants.js' diff --git a/src/index.ts b/src/index.ts index c90c781..562ef67 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,5 +1,5 @@ import multicastDNS from 'multicast-dns' -import { CustomEvent, EventEmitter } from '@libp2p/interfaces' +import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events' import { logger } from '@libp2p/logger' import * as query from './query.js' import { GoMulticastDNS } from './compat/index.js' diff --git a/test/compat/go-multicast-dns.spec.ts b/test/compat/go-multicast-dns.spec.ts index a31b3b0..e075b8f 100644 --- a/test/compat/go-multicast-dns.spec.ts +++ b/test/compat/go-multicast-dns.spec.ts @@ -6,7 +6,7 @@ import pDefer from 'p-defer' import { GoMulticastDNS } from '../../src/compat/index.js' import { Components } from '@libp2p/interfaces/components' import { stubInterface } from 'ts-sinon' -import type { AddressManager } from '@libp2p/interfaces' +import type { AddressManager } from '@libp2p/interfaces/address-manager' import type { PeerInfo } from '@libp2p/interfaces/peer-info' let port = 20000 diff --git a/test/compat/responder.spec.ts b/test/compat/responder.spec.ts index 74b3330..dde9d3f 100644 --- a/test/compat/responder.spec.ts +++ b/test/compat/responder.spec.ts @@ -13,7 +13,7 @@ import type { ResponsePacket } from 'multicast-dns' import { Components } from '@libp2p/interfaces/components' import { stubInterface } from 'ts-sinon' import { findPeerInfoInAnswers } from '../../src/compat/utils.js' -import type { AddressManager } from '@libp2p/interfaces' +import type { AddressManager } from '@libp2p/interfaces/address-manager' import type { PeerInfo } from '@libp2p/interfaces/peer-info' describe('Responder', () => { diff --git a/test/compliance.spec.ts b/test/compliance.spec.ts index 46d0fee..0b12ea1 100644 --- a/test/compliance.spec.ts +++ b/test/compliance.spec.ts @@ -4,7 +4,8 @@ import tests from '@libp2p/interface-compliance-tests/peer-discovery' import { Multiaddr } from '@multiformats/multiaddr' import { createEd25519PeerId } from '@libp2p/peer-id-factory' import { MulticastDNS } from '../src/index.js' -import { AddressManager, CustomEvent } from '@libp2p/interfaces' +import type { AddressManager } from '@libp2p/interfaces/address-manager' +import { CustomEvent } from '@libp2p/interfaces/events' import { Components } from '@libp2p/interfaces/components' import { stubInterface } from 'ts-sinon' diff --git a/test/multicast-dns.spec.ts b/test/multicast-dns.spec.ts index f4d5531..d1e452a 100644 --- a/test/multicast-dns.spec.ts +++ b/test/multicast-dns.spec.ts @@ -8,7 +8,7 @@ import { MulticastDNS } from './../src/index.js' import type { PeerId } from '@libp2p/interfaces/peer-id' import type { PeerInfo } from '@libp2p/interfaces/peer-info' import { stubInterface } from 'ts-sinon' -import type { AddressManager } from '@libp2p/interfaces' +import type { AddressManager } from '@libp2p/interfaces/address-manager' import { Components } from '@libp2p/interfaces/components' function getComponents (peerId: PeerId, multiaddrs: Multiaddr[]) {