mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 05:26:02 +00:00
b76b3e0e9b
* move pubsub of off switch, pass switch into pubsub * use join on lpstreams * properly cleanup up failed peers * fix tests * fix peertable hasPeerId * fix tests * rework sending, remove helpers from pubsubpeer, unify in broadcast * further split broadcast into send * use send where appropriate * use formatIt * improve trace Co-authored-by: Giovanni Petrantoni <giovanni@fragcolor.xyz>
20 lines
461 B
Nim
20 lines
461 B
Nim
import unittest
|
|
|
|
{.used.}
|
|
|
|
import ../../libp2p/[peerid, peerinfo,
|
|
crypto/crypto,
|
|
protocols/pubsub/rpc/message,
|
|
protocols/pubsub/rpc/messages]
|
|
|
|
let rng = newRng()
|
|
|
|
suite "Message":
|
|
test "signature":
|
|
var seqno = 11'u64
|
|
let
|
|
peer = PeerInfo.init(PrivateKey.random(ECDSA, rng[]).get())
|
|
msg = Message.init(peer, @[], "topic", seqno, sign = true)
|
|
|
|
check verify(msg, peer.peerId)
|