From 40e21e337564fa3fd0345586adb002411a0dd9a2 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 11 Jun 2021 16:33:47 -0600 Subject: [PATCH] Cleanup testinterop imports (#589) * cleanup exports/imports, specially for testinterop * export pubsub --- libp2p.nim | 5 +++-- libp2p/protocols/pubsub.nim | 3 +++ tests/testinterop.nim | 29 +++-------------------------- 3 files changed, 9 insertions(+), 28 deletions(-) create mode 100644 libp2p/protocols/pubsub.nim diff --git a/libp2p.nim b/libp2p.nim index 668fbb8..a07bbf0 100644 --- a/libp2p.nim +++ b/libp2p.nim @@ -27,7 +27,8 @@ import peerinfo, multiaddress, builders, - crypto/crypto] + crypto/crypto, + protocols/pubsub] import bearssl @@ -36,4 +37,4 @@ export connection, multiaddress, crypto, lpstream, bufferstream, bearssl, muxer, mplex, transport, tcptransport, noise, errors, cid, multihash, - multicodec, builders + multicodec, builders, pubsub diff --git a/libp2p/protocols/pubsub.nim b/libp2p/protocols/pubsub.nim new file mode 100644 index 0000000..c094c68 --- /dev/null +++ b/libp2p/protocols/pubsub.nim @@ -0,0 +1,3 @@ +import ./pubsub/[pubsub, floodsub, gossipsub] + +export pubsub, floodsub, gossipsub diff --git a/tests/testinterop.nim b/tests/testinterop.nim index 338c1bd..833a4c7 100644 --- a/tests/testinterop.nim +++ b/tests/testinterop.nim @@ -1,35 +1,12 @@ import options, tables import chronos, chronicles, stew/byteutils import helpers -import ../libp2p/[daemon/daemonapi, - protobuf/minprotobuf, - vbuffer, - multiaddress, - multicodec, - cid, - varint, - multihash, - builders, - peerid, - peerinfo, - switch, - stream/connection, - muxers/muxer, - crypto/crypto, - muxers/mplex/mplex, - muxers/muxer, - protocols/protocol, - protocols/identify, - transports/transport, - transports/tcptransport, - protocols/secure/secure, - protocols/pubsub/pubsub, - protocols/pubsub/floodsub, - protocols/pubsub/gossipsub] +import ../libp2p +import ../libp2p/[daemon/daemonapi, varint] type # TODO: Unify both PeerInfo structs - NativePeerInfo = peerinfo.PeerInfo + NativePeerInfo = libp2p.PeerInfo DaemonPeerInfo = daemonapi.PeerInfo proc writeLp*(s: StreamTransport, msg: string | seq[byte]): Future[int] {.gcsafe.} =