mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-19 21:04:41 +00:00
rust 1.53.0 updates (#2411)
## Issue Addressed `make lint` failing on rust 1.53.0. ## Proposed Changes 1.53.0 updates ## Additional Info I haven't figure out why yet, we were now hitting the recursion limit in a few crates. So I had to add `#![recursion_limit = "256"]` in a few places Co-authored-by: realbigsean <seananderson33@gmail.com> Co-authored-by: Michael Sproul <michael@sigmaprime.io>
This commit is contained in:
@@ -6,7 +6,7 @@ use crate::{test_utils::*, *};
|
||||
fn default_values() {
|
||||
let cache = CommitteeCache::default();
|
||||
|
||||
assert_eq!(cache.is_initialized_at(Epoch::new(0)), false);
|
||||
assert!(!cache.is_initialized_at(Epoch::new(0)));
|
||||
assert!(&cache.active_validator_indices().is_empty());
|
||||
assert_eq!(cache.get_beacon_committee(Slot::new(0), 0), None);
|
||||
assert_eq!(cache.get_attestation_duties(0), None);
|
||||
|
||||
@@ -105,10 +105,7 @@ mod tests {
|
||||
let indexed_vote_first = create_indexed_attestation(3, 1);
|
||||
let indexed_vote_second = create_indexed_attestation(3, 2);
|
||||
|
||||
assert_eq!(
|
||||
indexed_vote_first.is_double_vote(&indexed_vote_second),
|
||||
true
|
||||
)
|
||||
assert!(indexed_vote_first.is_double_vote(&indexed_vote_second))
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -116,10 +113,7 @@ mod tests {
|
||||
let indexed_vote_first = create_indexed_attestation(1, 1);
|
||||
let indexed_vote_second = create_indexed_attestation(2, 1);
|
||||
|
||||
assert_eq!(
|
||||
indexed_vote_first.is_double_vote(&indexed_vote_second),
|
||||
false
|
||||
);
|
||||
assert!(!indexed_vote_first.is_double_vote(&indexed_vote_second));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -127,10 +121,7 @@ mod tests {
|
||||
let indexed_vote_first = create_indexed_attestation(2, 1);
|
||||
let indexed_vote_second = create_indexed_attestation(1, 2);
|
||||
|
||||
assert_eq!(
|
||||
indexed_vote_first.is_surround_vote(&indexed_vote_second),
|
||||
true
|
||||
);
|
||||
assert!(indexed_vote_first.is_surround_vote(&indexed_vote_second));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -138,10 +129,7 @@ mod tests {
|
||||
let indexed_vote_first = create_indexed_attestation(4, 1);
|
||||
let indexed_vote_second = create_indexed_attestation(3, 2);
|
||||
|
||||
assert_eq!(
|
||||
indexed_vote_first.is_surround_vote(&indexed_vote_second),
|
||||
true
|
||||
);
|
||||
assert!(indexed_vote_first.is_surround_vote(&indexed_vote_second));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -149,10 +137,7 @@ mod tests {
|
||||
let indexed_vote_first = create_indexed_attestation(2, 2);
|
||||
let indexed_vote_second = create_indexed_attestation(1, 1);
|
||||
|
||||
assert_eq!(
|
||||
indexed_vote_first.is_surround_vote(&indexed_vote_second),
|
||||
false
|
||||
);
|
||||
assert!(!indexed_vote_first.is_surround_vote(&indexed_vote_second));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -160,10 +145,7 @@ mod tests {
|
||||
let indexed_vote_first = create_indexed_attestation(1, 1);
|
||||
let indexed_vote_second = create_indexed_attestation(2, 2);
|
||||
|
||||
assert_eq!(
|
||||
indexed_vote_first.is_surround_vote(&indexed_vote_second),
|
||||
false
|
||||
);
|
||||
assert!(!indexed_vote_first.is_surround_vote(&indexed_vote_second));
|
||||
}
|
||||
|
||||
ssz_and_tree_hash_tests!(IndexedAttestation<MainnetEthSpec>);
|
||||
|
||||
@@ -93,10 +93,10 @@ mod tests {
|
||||
|
||||
let epoch = Epoch::new(0);
|
||||
|
||||
assert_eq!(v.is_active_at(epoch), false);
|
||||
assert_eq!(v.is_exited_at(epoch), false);
|
||||
assert_eq!(v.is_withdrawable_at(epoch), false);
|
||||
assert_eq!(v.slashed, false);
|
||||
assert!(!v.is_active_at(epoch));
|
||||
assert!(!v.is_exited_at(epoch));
|
||||
assert!(!v.is_withdrawable_at(epoch));
|
||||
assert!(!v.slashed);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -108,9 +108,9 @@ mod tests {
|
||||
..Validator::default()
|
||||
};
|
||||
|
||||
assert_eq!(v.is_active_at(epoch - 1), false);
|
||||
assert_eq!(v.is_active_at(epoch), true);
|
||||
assert_eq!(v.is_active_at(epoch + 1), true);
|
||||
assert!(!v.is_active_at(epoch - 1));
|
||||
assert!(v.is_active_at(epoch));
|
||||
assert!(v.is_active_at(epoch + 1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -122,9 +122,9 @@ mod tests {
|
||||
..Validator::default()
|
||||
};
|
||||
|
||||
assert_eq!(v.is_exited_at(epoch - 1), false);
|
||||
assert_eq!(v.is_exited_at(epoch), true);
|
||||
assert_eq!(v.is_exited_at(epoch + 1), true);
|
||||
assert!(!v.is_exited_at(epoch - 1));
|
||||
assert!(v.is_exited_at(epoch));
|
||||
assert!(v.is_exited_at(epoch + 1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -136,9 +136,9 @@ mod tests {
|
||||
..Validator::default()
|
||||
};
|
||||
|
||||
assert_eq!(v.is_withdrawable_at(epoch - 1), false);
|
||||
assert_eq!(v.is_withdrawable_at(epoch), true);
|
||||
assert_eq!(v.is_withdrawable_at(epoch + 1), true);
|
||||
assert!(!v.is_withdrawable_at(epoch - 1));
|
||||
assert!(v.is_withdrawable_at(epoch));
|
||||
assert!(v.is_withdrawable_at(epoch + 1));
|
||||
}
|
||||
|
||||
ssz_and_tree_hash_tests!(Validator);
|
||||
|
||||
Reference in New Issue
Block a user