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