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

Commit e10d5f5

Browse files
authored
fix: update interfaces (#330)
1 parent b1649f8 commit e10d5f5

File tree

3 files changed

+19
-1
lines changed

3 files changed

+19
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
},
134134
"dependencies": {
135135
"@libp2p/crypto": "^0.22.11",
136-
"@libp2p/interfaces": "^1.3.31",
136+
"@libp2p/interfaces": "^1.3.32",
137137
"@libp2p/logger": "^1.1.4",
138138
"@libp2p/peer-id": "^1.1.10",
139139
"@libp2p/record": "^1.0.4",

src/dual-kad-dht.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import type { CID } from 'multiformats'
1010
import type { PeerId } from '@libp2p/interfaces/peer-id'
1111
import type { PeerDiscoveryEvents } from '@libp2p/interfaces/peer-discovery'
1212
import { Components, Initializable } from '@libp2p/interfaces/components'
13+
import { symbol } from '@libp2p/interfaces/peer-discovery'
1314

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

@@ -41,6 +42,14 @@ export class DualKadDHT extends EventEmitter<PeerDiscoveryEvents> implements Dua
4142
})
4243
}
4344

45+
get [symbol] (): true {
46+
return true
47+
}
48+
49+
get [Symbol.toStringTag] () {
50+
return '@libp2p/dual-kad-dht'
51+
}
52+
4453
init (components: Components): void {
4554
this.components = components
4655
this.wan.init(components)

src/kad-dht.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { Components, Initializable } from '@libp2p/interfaces/components'
2424
import type { KadDHTInit } from './index.js'
2525
import { validators as recordValidators } from '@libp2p/record/validators'
2626
import { selectors as recordSelectors } from '@libp2p/record/selectors'
27+
import { symbol } from '@libp2p/interfaces/peer-discovery'
2728

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

183+
get [symbol] (): true {
184+
return true
185+
}
186+
187+
get [Symbol.toStringTag] () {
188+
return '@libp2p/kad-dht'
189+
}
190+
182191
init (components: Components): void {
183192
this.components = components
184193

0 commit comments

Comments
 (0)