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

Commit

Permalink
fix: update interfaces (#329)
Browse files Browse the repository at this point in the history
Update interfaces to the latest version
  • Loading branch information
achingbrain authored May 4, 2022
1 parent 9088c61 commit b97187e
Show file tree
Hide file tree
Showing 13 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
},
"dependencies": {
"@libp2p/crypto": "^0.22.11",
"@libp2p/interfaces": "^1.3.29",
"@libp2p/interfaces": "^1.3.31",
"@libp2p/logger": "^1.1.4",
"@libp2p/peer-id": "^1.1.10",
"@libp2p/record": "^1.0.4",
Expand Down Expand Up @@ -169,7 +169,7 @@
"varint": "^6.0.0"
},
"devDependencies": {
"@libp2p/interface-compliance-tests": "^1.1.31",
"@libp2p/interface-compliance-tests": "^1.1.32",
"@libp2p/peer-id-factory": "^1.0.9",
"@libp2p/peer-store": "^1.0.11",
"@types/lodash.random": "^3.2.6",
Expand Down
3 changes: 2 additions & 1 deletion src/dual-kad-dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import merge from 'it-merge'
import { queryErrorEvent } from './query/events.js'
import type { KadDHT } from './kad-dht.js'
import type { DualDHT, QueryOptions } from '@libp2p/interfaces/dht'
import { AbortOptions, EventEmitter, CustomEvent } from '@libp2p/interfaces'
import type { AbortOptions } from '@libp2p/interfaces'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import type { CID } from 'multiformats'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
Expand Down
2 changes: 1 addition & 1 deletion src/kad-dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
import { Logger, logger } from '@libp2p/logger'
import type { QueryOptions, Validators, Selectors, DHT } from '@libp2p/interfaces/dht'
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { CID } from 'multiformats/cid'
import type { PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
Expand Down
5 changes: 3 additions & 2 deletions src/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import * as lp from 'it-length-prefixed'
import drain from 'it-drain'
import first from 'it-first'
import { Message } from './message/index.js'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import {
dialingPeerEvent,
sendingQueryEvent,
Expand All @@ -13,7 +13,8 @@ import {
} from './query/events.js'
import { logger } from '@libp2p/logger'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { AbortOptions, Startable } from '@libp2p/interfaces'
import type { AbortOptions } from '@libp2p/interfaces'
import type { Startable } from '@libp2p/interfaces/startable'
import type { Logger } from '@libp2p/logger'
import type { Duplex } from 'it-stream-types'
import type { PeerInfo } from '@libp2p/interfaces/peer-info'
Expand Down
2 changes: 1 addition & 1 deletion src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { logger } from '@libp2p/logger'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { peerIdFromString } from '@libp2p/peer-id'
import type { Datastore } from 'interface-datastore'
import type { Startable } from '@libp2p/interfaces'
import type { Startable } from '@libp2p/interfaces/startable'
import type { CID } from 'multiformats'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import { Components, Initializable } from '@libp2p/interfaces/components'
Expand Down
2 changes: 1 addition & 1 deletion src/query-self.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { TimeoutController } from 'timeout-abort-controller'
import { anySignal } from 'any-signal'
import { logger, Logger } from '@libp2p/logger'
import type { PeerRouting } from './peer-routing/index.js'
import type { Startable } from '@libp2p/interfaces'
import type { Startable } from '@libp2p/interfaces/startable'
import { pipe } from 'it-pipe'
import { Components, Initializable } from '@libp2p/interfaces/components'

Expand Down
4 changes: 2 additions & 2 deletions src/query/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { queryPath } from './query-path.js'
import merge from 'it-merge'
// @ts-expect-error setMaxListeners is missing from the types
import { setMaxListeners } from 'events'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces'
import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'
import { logger } from '@libp2p/logger'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { Startable } from '@libp2p/interfaces'
import type { Startable } from '@libp2p/interfaces/startable'
import type { QueryFunc } from './types.js'
import type { QueryOptions } from '@libp2p/interfaces/dht'
import { Components, Initializable } from '@libp2p/interfaces/components'
Expand Down
2 changes: 1 addition & 1 deletion src/query/query-path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { TimeoutController } from 'timeout-abort-controller'
import { anySignal } from 'any-signal'
import { queryErrorEvent } from './events.js'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { EventEmitter } from '@libp2p/interfaces'
import type { EventEmitter } from '@libp2p/interfaces/events'
import type { CleanUpEvents } from './manager.js'
import type { Logger } from '@libp2p/logger'
import type { QueryFunc } from '../query/types.js'
Expand Down
2 changes: 1 addition & 1 deletion src/routing-table/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { PROTOCOL_DHT } from '../constants.js'
import { TimeoutController } from 'timeout-abort-controller'
import { logger } from '@libp2p/logger'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { Startable } from '@libp2p/interfaces'
import type { Startable } from '@libp2p/interfaces/startable'
import type { Logger } from '@libp2p/logger'
import { Components, Initializable } from '@libp2p/interfaces/components'

Expand Down
4 changes: 2 additions & 2 deletions src/topology-listener.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { createTopology } from '@libp2p/topology'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces'
import { CustomEvent, EventEmitter } from '@libp2p/interfaces/events'
import { logger } from '@libp2p/logger'
import type { Logger } from '@libp2p/logger'
import type { Startable } from '@libp2p/interfaces'
import type { Startable } from '@libp2p/interfaces/startable'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import { Components, Initializable } from '@libp2p/interfaces/components'

Expand Down
2 changes: 1 addition & 1 deletion test/rpc/handlers/find-node.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Sinon, { SinonStubbedInstance } from 'sinon'
import { Components } from '@libp2p/interfaces/components'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { DHTMessageHandler } from '../../../src/rpc/index.js'
import type { AddressManager } from '@libp2p/interfaces'
import type { AddressManager } from '@libp2p/interfaces/address-manager'
import { stubInterface } from 'ts-sinon'
import type { StubbedInstance } from 'ts-sinon'

Expand Down
2 changes: 1 addition & 1 deletion test/rpc/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { RoutingTable } from '../../src/routing-table/index.js'
import type { Duplex } from 'it-stream-types'
import { mockStream, mockConnection, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'
import { Components } from '@libp2p/interfaces/components'
import { start } from '@libp2p/interface-compliance-tests'
import { start } from '@libp2p/interfaces/startable'

describe('rpc', () => {
let peerId: PeerId
Expand Down
4 changes: 2 additions & 2 deletions test/utils/test-dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { DualKadDHT } from '../../src/dual-kad-dht.js'
import { logger } from '@libp2p/logger'
import { Components } from '@libp2p/interfaces/components'
import type { KadDHTInit } from '../../src/index.js'
import type { AddressManager } from '@libp2p/interfaces'
import type { AddressManager } from '@libp2p/interfaces/address-manager'
import { stubInterface } from 'ts-sinon'
import { start } from '@libp2p/interface-compliance-tests'
import { start } from '@libp2p/interfaces/startable'
import delay from 'delay'

const log = logger('libp2p:kad-dht:test-dht')
Expand Down

0 comments on commit b97187e

Please sign in to comment.