From 0c55b37976202864842488e61fca9164af8d3c8b Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 30 Jan 2020 08:54:34 -0700 Subject: [PATCH] Add different shred test to test_tvu_peers_and_stakes --- core/src/cluster_info.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/core/src/cluster_info.rs b/core/src/cluster_info.rs index 02d829afad8e8f..0bd30051666ba3 100644 --- a/core/src/cluster_info.rs +++ b/core/src/cluster_info.rs @@ -2722,6 +2722,14 @@ mod tests { cluster_info.insert_info(contact_info); stakes.insert(id3, 10); + // normal but with different shred version + let id4 = Pubkey::new(&[4u8; 32]); + let mut contact_info = ContactInfo::new_localhost(&id4, timestamp()); + contact_info.shred_version = 1; + assert_ne!(contact_info.shred_version, d.shred_version); + cluster_info.insert_info(contact_info.clone()); + stakes.insert(id4, 10); + let stakes = Arc::new(stakes); let (peers, peers_and_stakes) = cluster_info.sorted_tvu_peers_and_stakes(Some(stakes)); assert_eq!(peers.len(), 2);