Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Add different shred test to test_tvu_peers_and_stakes #8033

Merged
merged 1 commit into from
Jan 30, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions core/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down