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

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 baaadc4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion core/src/cluster_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2722,8 +2722,17 @@ 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));
let (peers, peers_and_stakes) =
dbg!(cluster_info.sorted_tvu_peers_and_stakes(Some(stakes)));
assert_eq!(peers.len(), 2);
assert_eq!(peers[0].id, id);
assert_eq!(peers[1].id, id2);
Expand Down

0 comments on commit baaadc4

Please sign in to comment.