From eef5dd004226d1a7cf58ccd6876cd2154c155309 Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Fri, 29 Jan 2021 10:14:53 -0600 Subject: [PATCH] fix imports --- libp2p/muxers/mplex/coder.nim | 2 +- libp2p/muxers/mplex/lpchannel.nim | 3 +-- libp2p/muxers/mplex/mplex.nim | 5 ++--- libp2p/stream/connection.nim | 5 +++-- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/libp2p/muxers/mplex/coder.nim b/libp2p/muxers/mplex/coder.nim index c09fdd2..fc917b9 100644 --- a/libp2p/muxers/mplex/coder.nim +++ b/libp2p/muxers/mplex/coder.nim @@ -40,7 +40,7 @@ type # https://github.com/libp2p/specs/tree/master/mplex#writing-to-a-stream const MaxMsgSize* = 1 shl 20 # 1mb -proc newInvalidMplexMsgType*(): ref InvalidMplexMsgType = +proc newInvalidMplexMsgType(): ref InvalidMplexMsgType = newException(InvalidMplexMsgType, "invalid message type") proc readMsg*(conn: Connection): Future[Msg] {.async, gcsafe.} = diff --git a/libp2p/muxers/mplex/lpchannel.nim b/libp2p/muxers/mplex/lpchannel.nim index aa61124..91c54fb 100644 --- a/libp2p/muxers/mplex/lpchannel.nim +++ b/libp2p/muxers/mplex/lpchannel.nim @@ -10,10 +10,9 @@ {.push raises: [Defect].} import std/[oids, strformat] -import chronos, chronicles, metrics +import pkg/[chronos, chronicles, metrics, nimcrypto/utils] import ./coder, ../muxer, - nimcrypto/utils, ../../stream/[bufferstream, connection, streamseq], ../../peerinfo diff --git a/libp2p/muxers/mplex/mplex.nim b/libp2p/muxers/mplex/mplex.nim index 2d84ca2..d56912d 100644 --- a/libp2p/muxers/mplex/mplex.nim +++ b/libp2p/muxers/mplex/mplex.nim @@ -34,9 +34,8 @@ when defined(libp2p_expensive_metrics): "mplex channels", labels = ["initiator", "peer"]) type - MplexError* = object of MuxerError - TooManyChannels* = object of MplexError - InvalidChannelIdError* = object of MplexError + TooManyChannels* = object of MuxerError + InvalidChannelIdError* = object of MuxerError Mplex* = ref object of Muxer channels: array[bool, Table[uint64, LPChannel]] diff --git a/libp2p/stream/connection.nim b/libp2p/stream/connection.nim index 67c446f..f06d962 100644 --- a/libp2p/stream/connection.nim +++ b/libp2p/stream/connection.nim @@ -13,9 +13,10 @@ import std/[hashes, oids, strformat] import chronicles, chronos, metrics import lpstream, ../multiaddress, - ../peerinfo + ../peerinfo, + ../errors -export lpstream, peerinfo +export lpstream, peerinfo, errors logScope: topics = "libp2p connection"