mirror of
https://github.com/codex-storage/nim-libp2p.git
synced 2025-01-09 10:41:57 +00:00
d522537b19
* reuse single RNG instance for all crypto key generation * use foolproof rng * initRng -> newRng (because it's ref) * fix test * imports/exports, chat fix * fix rsa * imports and exports * work around threadvar issue * fixup * mac workaround test
19 lines
424 B
Nim
19 lines
424 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":
|
|
let
|
|
peer = PeerInfo.init(PrivateKey.random(ECDSA, rng[]).get())
|
|
msg = Message.init(peer, @[], "topic", sign = true)
|
|
|
|
check verify(msg, peer)
|