mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-17 12:58:31 +00:00
Test fixes and Cargo.lock update
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -3411,6 +3411,7 @@ dependencies = [
|
||||
"slashing_protection",
|
||||
"slog",
|
||||
"sloggers",
|
||||
"store",
|
||||
"task_executor",
|
||||
"tempfile",
|
||||
"types",
|
||||
@@ -3657,7 +3658,6 @@ dependencies = [
|
||||
"itertools",
|
||||
"parking_lot",
|
||||
"serde",
|
||||
"smallvec",
|
||||
"tree_hash",
|
||||
"triomphe",
|
||||
"typenum",
|
||||
|
||||
@@ -1009,6 +1009,7 @@ mod test {
|
||||
|
||||
mod collect_valid_votes {
|
||||
use super::*;
|
||||
use types::VList;
|
||||
|
||||
fn get_eth1_data_vec(n: u64, block_number_offset: u64) -> Vec<(Eth1Data, BlockNumber)> {
|
||||
(0..n)
|
||||
@@ -1056,12 +1057,14 @@ mod test {
|
||||
|
||||
let votes_to_consider = get_eth1_data_vec(slots, 0);
|
||||
|
||||
*state.eth1_data_votes_mut() = votes_to_consider[0..slots as usize / 4]
|
||||
.iter()
|
||||
.map(|(eth1_data, _)| eth1_data)
|
||||
.cloned()
|
||||
.collect::<Vec<_>>()
|
||||
.into();
|
||||
*state.eth1_data_votes_mut() = VList::new(
|
||||
votes_to_consider[0..slots as usize / 4]
|
||||
.iter()
|
||||
.map(|(eth1_data, _)| eth1_data)
|
||||
.cloned()
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let votes =
|
||||
collect_valid_votes(&state, &votes_to_consider.clone().into_iter().collect());
|
||||
@@ -1085,12 +1088,14 @@ mod test {
|
||||
.expect("should have some eth1 data")
|
||||
.clone();
|
||||
|
||||
*state.eth1_data_votes_mut() = vec![duplicate_eth1_data.clone(); 4]
|
||||
.iter()
|
||||
.map(|(eth1_data, _)| eth1_data)
|
||||
.cloned()
|
||||
.collect::<Vec<_>>()
|
||||
.into();
|
||||
*state.eth1_data_votes_mut() = VList::new(
|
||||
vec![duplicate_eth1_data.clone(); 4]
|
||||
.iter()
|
||||
.map(|(eth1_data, _)| eth1_data)
|
||||
.cloned()
|
||||
.collect::<Vec<_>>(),
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
let votes = collect_valid_votes(&state, &votes_to_consider.into_iter().collect());
|
||||
assert_votes!(
|
||||
|
||||
Reference in New Issue
Block a user