clippy
This commit is contained in:
committed by
Michael Vines
parent
d611337394
commit
01a4889b53
@ -921,7 +921,7 @@ mod tests {
|
|||||||
..Entry::default()
|
..Entry::default()
|
||||||
};
|
};
|
||||||
let max_hash_tx_entry = Entry {
|
let max_hash_tx_entry = Entry {
|
||||||
transactions: vec![tx.clone()],
|
transactions: vec![tx],
|
||||||
num_hashes: u64::MAX,
|
num_hashes: u64::MAX,
|
||||||
..Entry::default()
|
..Entry::default()
|
||||||
};
|
};
|
||||||
@ -966,13 +966,13 @@ mod tests {
|
|||||||
tick_hash_count = 0;
|
tick_hash_count = 0;
|
||||||
|
|
||||||
// partial tx entry without tick entry should succeed
|
// partial tx entry without tick entry should succeed
|
||||||
entries = vec![partial_tx_entry.clone()];
|
entries = vec![partial_tx_entry];
|
||||||
assert!(entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
assert!(entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
||||||
assert_eq!(tick_hash_count, hashes_per_tick - 1);
|
assert_eq!(tick_hash_count, hashes_per_tick - 1);
|
||||||
tick_hash_count = 0;
|
tick_hash_count = 0;
|
||||||
|
|
||||||
// full tx entry with tick entry should succeed
|
// full tx entry with tick entry should succeed
|
||||||
entries = vec![full_tx_entry.clone(), no_hash_tick_entry.clone()];
|
entries = vec![full_tx_entry.clone(), no_hash_tick_entry];
|
||||||
assert!(entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
assert!(entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
||||||
assert_eq!(tick_hash_count, 0);
|
assert_eq!(tick_hash_count, 0);
|
||||||
|
|
||||||
@ -989,7 +989,7 @@ mod tests {
|
|||||||
tick_hash_count = 0;
|
tick_hash_count = 0;
|
||||||
|
|
||||||
// tx entry and a tick should succeed
|
// tx entry and a tick should succeed
|
||||||
entries = vec![single_hash_tx_entry.clone(), partial_tick_entry.clone()];
|
entries = vec![single_hash_tx_entry.clone(), partial_tick_entry];
|
||||||
assert!(entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
assert!(entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
||||||
assert_eq!(tick_hash_count, 0);
|
assert_eq!(tick_hash_count, 0);
|
||||||
|
|
||||||
@ -1008,7 +1008,7 @@ mod tests {
|
|||||||
tick_hash_count = 0;
|
tick_hash_count = 0;
|
||||||
|
|
||||||
// check overflow saturation should fail
|
// check overflow saturation should fail
|
||||||
entries = vec![max_hash_tx_entry.clone(), full_tick_entry];
|
entries = vec![max_hash_tx_entry, full_tick_entry];
|
||||||
assert!(!entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
assert!(!entries.verify_tick_hash_count(&mut tick_hash_count, hashes_per_tick));
|
||||||
assert_eq!(tick_hash_count, u64::MAX);
|
assert_eq!(tick_hash_count, u64::MAX);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user