From 8e76ecfa9feb8e88a5598d9b15f838dd6e10aa11 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 8 Feb 2021 14:19:00 +0100 Subject: [PATCH] Fix: adapt to latest libp2p api Fixes compilation error. --- ipfs/dht/routing.nim | 6 +++++- tests/ipfs/testDhtRouting.nim | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ipfs/dht/routing.nim b/ipfs/dht/routing.nim index 59d7ca54..5a4a1632 100644 --- a/ipfs/dht/routing.nim +++ b/ipfs/dht/routing.nim @@ -1,4 +1,8 @@ -import pkg/libp2p +import pkg/libp2p/peerinfo +import pkg/libp2p/cid + +export peerinfo +export cid type RoutingTable* = object diff --git a/tests/ipfs/testDhtRouting.nim b/tests/ipfs/testDhtRouting.nim index 82a3abfa..b35d23c1 100644 --- a/tests/ipfs/testDhtRouting.nim +++ b/tests/ipfs/testDhtRouting.nim @@ -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()