nim-libp2p/tests/testpeerinfo.nim
Menduist d02735dc46
Remove peer info (#610)
Peer Info is now for local peer data only.
For other peers info, use the peer store.

Previous reference to peer info are replaced with the peerid
2021-09-08 11:07:46 +02:00

19 lines
444 B
Nim

{.used.}
import options, bearssl
import chronos
import ../libp2p/crypto/crypto,
../libp2p/peerinfo,
../libp2p/peerid
import ./helpers
suite "PeerInfo":
test "Should init with private key":
let seckey = PrivateKey.random(ECDSA, rng[]).get()
var peerInfo = PeerInfo.init(seckey)
var peerId = PeerID.init(seckey).get()
check peerId == peerInfo.peerId
check seckey.getPublicKey().get() == peerInfo.publicKey