Skip to content

Commit

Permalink
Add different shred test to test_tvu_peers_and_stakes
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jan 30, 2020
1 parent 64c42e2 commit 9a01b28
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit 9a01b28

Please sign in to comment.