From 77f34af73793cd50c774c718c9a051af1c47aa0f Mon Sep 17 00:00:00 2001 From: cheatfate Date: Mon, 4 Mar 2019 20:51:10 +0200 Subject: [PATCH] Fix testdaemon.nim. --- examples/bootstrap.nim | 2 +- examples/node.nim | 6 ++++-- tests/testdaemon.nim | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/examples/bootstrap.nim b/examples/bootstrap.nim index 94c8338e6..0a4014c3d 100644 --- a/examples/bootstrap.nim +++ b/examples/bootstrap.nim @@ -28,7 +28,7 @@ proc main() {.async.} = ticket: PubsubTicket, message: PubSubMessage): Future[bool] {.async.} = let msglen = len(message.data) - echo "= Recieved pubsub message wit length ", msglen, + echo "= Recieved pubsub message with length ", msglen, " bytes from peer ", message.peer.pretty() echo dumpHex(message.data) await api.dumpSubscribedPeers() diff --git a/examples/node.nim b/examples/node.nim index 1bd5ca601..8bab23edd 100644 --- a/examples/node.nim +++ b/examples/node.nim @@ -16,8 +16,10 @@ proc main(bn: string) {.async.} = ticket: PubsubTicket, message: PubSubMessage): Future[bool] {.async.} = let msglen = len(message.data) - echo "= Recieved pubsub message wit length ", msglen, - " bytes from peer ", message.peer.pretty() + echo "= Recieved pubsub message with length ", msglen, + " bytes from peer ", message.peer.pretty(), ": " + var strdata = cast[string](message.data) + echo strdata result = true var ticket = await api.pubsubSubscribe("test-net", pubsubLogger) diff --git a/tests/testdaemon.nim b/tests/testdaemon.nim index 756542631..10ecaad20 100644 --- a/tests/testdaemon.nim +++ b/tests/testdaemon.nim @@ -1,7 +1,7 @@ import unittest import chronos import ../libp2p/daemon/daemonapi, ../libp2p/multiaddress, ../libp2p/multicodec, - ../libp2p/cid, ../libp2p/multihash + ../libp2p/cid, ../libp2p/multihash, ../libp2p/peer proc identitySpawnTest(): Future[bool] {.async.} = var api = await newDaemonApi()