parent
b0a1166c3c
commit
8e76ecfa9f
|
@ -1,4 +1,8 @@
|
|||
import pkg/libp2p
|
||||
import pkg/libp2p/peerinfo
|
||||
import pkg/libp2p/cid
|
||||
|
||||
export peerinfo
|
||||
export cid
|
||||
|
||||
type
|
||||
RoutingTable* = object
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
import std/unittest
|
||||
import pkg/libp2p
|
||||
import pkg/ipfs/ipfsobject
|
||||
import pkg/ipfs/dht/routing
|
||||
|
||||
suite "DHT routing table":
|
||||
|
||||
test "finds peers closest to some content":
|
||||
let peer1 = PeerInfo(peer: PeerId(data: @[1'u8]))
|
||||
let peer2 = PeerInfo(peer: PeerId(data: @[2'u8]))
|
||||
let peer1 = PeerInfo(peerId: PeerId(data: @[1'u8]))
|
||||
let peer2 = PeerInfo(peerId: PeerId(data: @[2'u8]))
|
||||
let contentId = IpfsObject(data: @[]).cid
|
||||
|
||||
var table = RoutingTable()
|
||||
|
|
Loading…
Reference in New Issue