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

fix: update interfaces #330

Merged
merged 1 commit into from
May 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 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.31",
"@libp2p/interfaces": "^1.3.32",
"@libp2p/logger": "^1.1.4",
"@libp2p/peer-id": "^1.1.10",
"@libp2p/record": "^1.0.4",
Expand Down
9 changes: 9 additions & 0 deletions src/dual-kad-dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { CID } from 'multiformats'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
import { Components, Initializable } from '@libp2p/interfaces/components'
import { symbol } from '@libp2p/interfaces/peer-discovery'

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

Expand Down Expand Up @@ -41,6 +42,14 @@ export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements Dua
})
}

get [symbol] (): true {
return true
}

get [Symbol.toStringTag] () {
return '@libp2p/dual-kad-dht'
}

init (components: Components): void {
this.components = components
this.wan.init(components)
Expand Down
9 changes: 9 additions & 0 deletions src/kad-dht.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import { Components, Initializable } from '@libp2p/interfaces/components'
import type { KadDHTInit } from './index.js'
import { validators as recordValidators } from '@libp2p/record/validators'
import { selectors as recordSelectors } from '@libp2p/record/selectors'
import { symbol } from '@libp2p/interfaces/peer-discovery'

/**
* A DHT implementation modelled after Kademlia with S/Kademlia modifications.
Expand Down Expand Up @@ -179,6 +180,14 @@ export class KadDHT extends EventEmitter<PeerDiscoveryEvents> implements DHT, In
})
}

get [symbol] (): true {
return true
}

get [Symbol.toStringTag] () {
return '@libp2p/kad-dht'
}

init (components: Components): void {
this.components = components

Expand Down