mirror of
https://github.com/status-im/nim-libp2p.git
synced 2025-01-11 21:44:24 +00:00
d02735dc46
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
|