mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-12 05:54:51 +00:00
d7bab37119
* Fix gossip messages seqno according to spec * Add peers back to gossipsub table, slow down heartbeat * Revert "Add peers back to gossipsub table, slow down heartbeat" This reverts commit 01e2e62172a7793bb17f0eb8314e2faeb2682173. * make seqno a threadvar, remove from peerinfo * seqno refactor, into pubsub
20 lines
454 B
Nim
20 lines
454 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)
|