Add a constructor to generate random pubkeys

This commit is contained in:
Greg Fitzgerald
2019-03-30 21:37:33 -06:00
parent 32683cac7c
commit fcef54d062
51 changed files with 263 additions and 298 deletions

View File

@@ -165,7 +165,6 @@ impl Crds {
mod test {
use super::*;
use crate::contact_info::ContactInfo;
use solana_sdk::signature::{Keypair, KeypairUtil};
#[test]
fn test_insert() {
@@ -302,11 +301,11 @@ mod test {
fn test_label_order() {
let v1 = VersionedCrdsValue::new(
1,
CrdsValue::ContactInfo(ContactInfo::new_localhost(&Keypair::new().pubkey(), 0)),
CrdsValue::ContactInfo(ContactInfo::new_localhost(&Pubkey::new_rand(), 0)),
);
let v2 = VersionedCrdsValue::new(
1,
CrdsValue::ContactInfo(ContactInfo::new_localhost(&Keypair::new().pubkey(), 0)),
CrdsValue::ContactInfo(ContactInfo::new_localhost(&Pubkey::new_rand(), 0)),
);
assert_ne!(v1, v2);
assert!(!(v1 == v2));