Enable cluster tests (#3372)

* Cluster tests

* stable!

* fixup! stable!

* fixup! fixup! stable!

* fixup! fixup! fixup! stable!

* fixup! fixup! fixup! fixup! stable!

* fixed space

* add getNumBlocksSinceSignatureConfirmation entry for the json rpc docs

* Check in upcoming epochs for potential leadership slots in next_leader_slot()
This commit is contained in:
anatoly yakovenko
2019-03-21 07:43:21 -07:00
committed by GitHub
parent 402a733cd7
commit 148e08a8a5
11 changed files with 312 additions and 54 deletions

View File

@@ -192,13 +192,13 @@ impl<T: Clone> StatusCache<T> {
pub fn get_signature_status_all<U>(
checkpoints: &[U],
signature: &Signature,
) -> Option<Result<(), T>>
) -> Option<(usize, Result<(), T>)>
where
U: Deref<Target = Self>,
{
for c in checkpoints {
for (i, c) in checkpoints.iter().enumerate() {
if let Some(status) = c.get_signature_status(signature) {
return Some(status);
return Some((i, status));
}
}
None
@@ -257,7 +257,7 @@ mod tests {
let checkpoints = [&second, &first];
assert_eq!(
BankStatusCache::get_signature_status_all(&checkpoints, &sig),
Some(Ok(())),
Some((1, Ok(()))),
);
assert!(StatusCache::has_signature_all(&checkpoints, &sig));
}