Skip to content

Commit

Permalink
chore: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Nov 30, 2023
1 parent ee39905 commit 81e3fcb
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 22 deletions.
5 changes: 2 additions & 3 deletions packages/libp2p-daemon-client/src/dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ import {
DHTRequest,
DHTResponse
} from '@libp2p/daemon-protocol'
import { CodeError } from '@libp2p/interface/errors'
import { isPeerId, type PeerId } from '@libp2p/interface/peer-id'
import { CodeError } from '@libp2p/interface'
import { isPeerId, type PeerId, type PeerInfo } from '@libp2p/interface'
import { peerIdFromBytes } from '@libp2p/peer-id'
import { multiaddr } from '@multiformats/multiaddr'
import { CID } from 'multiformats/cid'
import type { DaemonClient } from './index.js'
import type { PeerInfo } from '@libp2p/interface/peer-info'

export class DHT {
private readonly client: DaemonClient
Expand Down
9 changes: 3 additions & 6 deletions packages/libp2p-daemon-client/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
import { type PSMessage, Request, Response, StreamInfo } from '@libp2p/daemon-protocol'
import { StreamHandler } from '@libp2p/daemon-protocol/stream-handler'
import { passThroughUpgrader } from '@libp2p/daemon-protocol/upgrader'
import { CodeError } from '@libp2p/interface/errors'
import { isPeerId, type PeerId } from '@libp2p/interface/peer-id'
import { defaultLogger, logger } from '@libp2p/logger'
import { CodeError } from '@libp2p/interface'
import { isPeerId, type PeerId, type MultiaddrConnection, type PeerInfo, type Transport } from '@libp2p/interface'
import { logger } from '@libp2p/logger'
import { peerIdFromBytes } from '@libp2p/peer-id'
import { tcp } from '@libp2p/tcp'
import { multiaddr, isMultiaddr } from '@multiformats/multiaddr'
import { DHT } from './dht.js'
import { Pubsub } from './pubsub.js'
import type { MultiaddrConnection } from '@libp2p/interface/connection'
import type { PeerInfo } from '@libp2p/interface/peer-info'
import type { Transport } from '@libp2p/interface/transport'
import type { Multiaddr } from '@multiformats/multiaddr'
import type { Duplex, Source } from 'it-stream-types'
import type { CID } from 'multiformats/cid'
Expand Down
4 changes: 2 additions & 2 deletions packages/libp2p-daemon-client/src/pubsub.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import {
PSRequest,
PSMessage
} from '@libp2p/daemon-protocol'
import { CodeError } from '@libp2p/interface/errors'
import { CodeError } from '@libp2p/interface'
import { peerIdFromBytes } from '@libp2p/peer-id'
import type { DaemonClient, Subscription } from './index.js'
import type { PeerId } from '@libp2p/interface/peer-id'
import type { PeerId } from '@libp2p/interface'

export class Pubsub {
private readonly client: DaemonClient
Expand Down
5 changes: 2 additions & 3 deletions packages/libp2p-daemon-client/test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-env mocha */

import { createServer, type Libp2pServer } from '@libp2p/daemon-server'
import { isPeerId } from '@libp2p/interface/peer-id'
import { isPeerId } from '@libp2p/interface'
import { mockConnection, mockDuplex, mockMultiaddrConnection } from '@libp2p/interface-compliance-tests/mocks'
import { peerIdFromString } from '@libp2p/peer-id'
import { multiaddr } from '@multiformats/multiaddr'
Expand All @@ -10,8 +10,7 @@ import sinon from 'sinon'
import { type StubbedInstance, stubInterface } from 'sinon-ts'
import { createClient, type DaemonClient } from '../src/index.js'
import type { GossipSub } from '@chainsafe/libp2p-gossipsub'
import type { Libp2p } from '@libp2p/interface'
import type { PeerStore } from '@libp2p/interface/peer-store'
import type { Libp2p, PeerStore } from '@libp2p/interface'
import type { KadDHT } from '@libp2p/kad-dht'

const defaultMultiaddr = multiaddr('/ip4/0.0.0.0/tcp/0')
Expand Down
3 changes: 1 addition & 2 deletions packages/libp2p-daemon-client/test/stream.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
import { createClient, type DaemonClient } from '../src/index.js'
import type { GossipSub } from '@chainsafe/libp2p-gossipsub'
import type { Libp2p } from '@libp2p/interface'
import type { PeerStore } from '@libp2p/interface/peer-store'
import type { Libp2p, PeerStore } from '@libp2p/interface'
import type { KadDHT } from '@libp2p/kad-dht'

const defaultMultiaddr = multiaddr('/ip4/0.0.0.0/tcp/0')
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-protocol/src/upgrader.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Upgrader } from '@libp2p/interface/transport'
import type { Upgrader } from '@libp2p/interface'

export const passThroughUpgrader: Upgrader = {
// @ts-expect-error should return a connection
Expand Down
2 changes: 1 addition & 1 deletion packages/libp2p-daemon-server/src/dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
import { logger } from '@libp2p/logger'
import drain from 'it-drain'
import { ErrorResponse, OkResponse } from './responses.js'
import type { PeerId } from '@libp2p/interface/peer-id'
import type { PeerId } from '@libp2p/interface'
import type { KadDHT } from '@libp2p/kad-dht'
import type { CID } from 'multiformats/cid'

Expand Down
5 changes: 1 addition & 4 deletions packages/libp2p-daemon-server/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ import { DHTOperations } from './dht.js'
import { PubSubOperations } from './pubsub.js'
import { ErrorResponse, OkResponse } from './responses.js'
import type { GossipSub } from '@chainsafe/libp2p-gossipsub'
import type { Libp2p } from '@libp2p/interface'
import type { Connection, MultiaddrConnection, Stream } from '@libp2p/interface/connection'
import type { Listener, Transport } from '@libp2p/interface/transport'
import type { Libp2p, Connection, MultiaddrConnection, Stream, Listener, Transport } from '@libp2p/interface'
import type { KadDHT } from '@libp2p/kad-dht'
import type { Multiaddr } from '@multiformats/multiaddr'

Expand Down Expand Up @@ -59,7 +57,6 @@ export class Server implements Libp2pServer {
this.multiaddr = multiaddr
this.libp2p = libp2pNode
this.tcp = tcp()({
// @ts-expect-error this field will be present post v1
logger: defaultLogger()
})
this.listener = this.tcp.createListener({
Expand Down

0 comments on commit 81e3fcb

Please sign in to comment.