Fix testdaemon.nim.
This commit is contained in:
parent
53467d028f
commit
77f34af737
|
@ -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()
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue