Fix: adapt to latest libp2p api

Fixes compilation error.
This commit is contained in:
Mark Spanbroek 2021-02-08 14:19:00 +01:00 committed by markspanbroek
parent b0a1166c3c
commit 8e76ecfa9f
2 changed files with 7 additions and 4 deletions

View File

@ -1,4 +1,8 @@
import pkg/libp2p
import pkg/libp2p/peerinfo
import pkg/libp2p/cid
export peerinfo
export cid
type
RoutingTable* = object

View File

@ -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()