mirror of
https://github.com/logos-storage/nim-libp2p.git
synced 2026-01-03 22:23:09 +00:00
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
19 lines
444 B
Nim
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
|