committed by
GitHub
parent
a71833c17b
commit
fb4d8e1f62
@ -561,7 +561,7 @@ mod tests {
|
||||
}
|
||||
|
||||
fn pubkeys(signers: &[&dyn Signer]) -> Vec<Pubkey> {
|
||||
signers.into_iter().map(|x| x.pubkey()).collect()
|
||||
signers.iter().map(|x| x.pubkey()).collect()
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -99,9 +99,9 @@ mod tests {
|
||||
slot_history.add(MAX_ENTRIES);
|
||||
assert_eq!(slot_history.check(0), Check::TooOld);
|
||||
assert_eq!(slot_history.check(1), Check::NotFound);
|
||||
assert_eq!(slot_history.check(2), Check::Found);
|
||||
assert_eq!(slot_history.check(20), Check::Found);
|
||||
assert_eq!(slot_history.check(MAX_ENTRIES), Check::Found);
|
||||
for i in &[2, 20, MAX_ENTRIES] {
|
||||
assert_eq!(slot_history.check(*i), Check::Found);
|
||||
}
|
||||
for i in 3..20 {
|
||||
assert_eq!(slot_history.check(i), Check::NotFound, "i: {}", i);
|
||||
}
|
||||
@ -113,12 +113,9 @@ mod tests {
|
||||
info!("add max_entries + 3");
|
||||
let slot = 3 * MAX_ENTRIES + 3;
|
||||
slot_history.add(slot);
|
||||
assert_eq!(slot_history.check(0), Check::TooOld);
|
||||
assert_eq!(slot_history.check(1), Check::TooOld);
|
||||
assert_eq!(slot_history.check(2), Check::TooOld);
|
||||
assert_eq!(slot_history.check(20), Check::TooOld);
|
||||
assert_eq!(slot_history.check(21), Check::TooOld);
|
||||
assert_eq!(slot_history.check(MAX_ENTRIES), Check::TooOld);
|
||||
for i in &[0, 1, 2, 20, 21, MAX_ENTRIES] {
|
||||
assert_eq!(slot_history.check(*i), Check::TooOld);
|
||||
}
|
||||
let start = slot - MAX_ENTRIES + 1;
|
||||
let end = slot;
|
||||
for i in start..end {
|
||||
|
Reference in New Issue
Block a user