2020-05-27 18:33:49 +00:00
|
|
|
import unittest
|
2020-06-28 15:56:38 +00:00
|
|
|
|
2020-07-01 06:25:09 +00:00
|
|
|
import ../../libp2p/[peerid, peerinfo,
|
2020-05-27 18:33:49 +00:00
|
|
|
crypto/crypto,
|
|
|
|
protocols/pubsub/rpc/message,
|
|
|
|
protocols/pubsub/rpc/messages]
|
|
|
|
|
|
|
|
suite "Message":
|
2020-06-28 15:56:38 +00:00
|
|
|
test "signature":
|
|
|
|
let
|
|
|
|
peer = PeerInfo.init(PrivateKey.random(ECDSA).get())
|
|
|
|
msg = Message.init(peer, @[], "topic", sign = true)
|
2020-05-27 18:33:49 +00:00
|
|
|
|
2020-06-28 15:56:38 +00:00
|
|
|
check verify(msg, peer)
|