From 663ce6c589be3eb1e7c287dde34f940a95ad7e0b Mon Sep 17 00:00:00 2001 From: Dmitriy Ryajov Date: Mon, 23 Sep 2019 16:35:23 -0600 Subject: [PATCH] misc: nimpretty --- libp2p/protocols/pubsub/rpcmsg.nim | 2 +- libp2p/transports/transport.nim | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/libp2p/protocols/pubsub/rpcmsg.nim b/libp2p/protocols/pubsub/rpcmsg.nim index 3ae50ba30..4109b61da 100644 --- a/libp2p/protocols/pubsub/rpcmsg.nim +++ b/libp2p/protocols/pubsub/rpcmsg.nim @@ -57,7 +57,7 @@ proc encodeSubs(subs: SubOpts, buff: var ProtoBuffer) {.gcsafe.} = buff.write(initProtoField(2, subs.topic)) proc encodeRpcMsg*(msg: RPCMsg): ProtoBuffer {.gcsafe.} = - result = initProtoBuffer({WithVarintLength}) + result = initProtoBuffer({WithVarintLength}) trace "encoding msg: ", msg = msg if msg.subscriptions.len > 0: diff --git a/libp2p/transports/transport.nim b/libp2p/transports/transport.nim index ff89458d4..be88d9bbb 100644 --- a/libp2p/transports/transport.nim +++ b/libp2p/transports/transport.nim @@ -9,8 +9,10 @@ import sequtils import chronos -import ../peerinfo, ../connection, - ../multiaddress, ../multicodec +import ../peerinfo, + ../connection, + ../multiaddress, + ../multicodec type ConnHandler* = proc (conn: Connection): Future[void] {.gcsafe.} @@ -40,19 +42,19 @@ method close*(t: Transport) {.base, async, gcsafe.} = method listen*(t: Transport, ma: MultiAddress, - handler: ConnHandler): + handler: ConnHandler): Future[Future[void]] {.base, async, gcsafe.} = ## listen for incoming connections t.ma = ma t.handler = handler method dial*(t: Transport, - address: MultiAddress): + address: MultiAddress): Future[Connection] {.base, async, gcsafe.} = ## dial a peer discard -method upgrade*(t: Transport) {.base, async, gcsafe.} = +method upgrade*(t: Transport) {.base, async, gcsafe.} = ## base upgrade method that the transport uses to perform ## transport specific upgrades discard