mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-12 22:14:35 +00:00
ac4e060e1a
* adding raises defect across the codebase * use unittest2 * add windows deps caching * update mingw link * die on failed peerinfo initialization * use result.expect instead of get * use expect more consistently and rework inits * use expect more consistently * throw on missing public key * remove unused closure annotation * merge master
21 lines
476 B
Nim
21 lines
476 B
Nim
import unittest2
|
|
|
|
{.used.}
|
|
|
|
import options
|
|
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(some(peer), @[], "topic", some(seqno), sign = true)
|
|
|
|
check verify(msg)
|