mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Merge remote-tracking branch 'origin/master' into spec-v0.12
This commit is contained in:
@@ -80,10 +80,9 @@ impl ForkChoiceTestDefinition {
|
||||
finalized_epoch,
|
||||
&justified_state_balances,
|
||||
)
|
||||
.expect(&format!(
|
||||
"find_head op at index {} returned error",
|
||||
op_index
|
||||
));
|
||||
.unwrap_or_else(|_| {
|
||||
panic!("find_head op at index {} returned error", op_index)
|
||||
});
|
||||
|
||||
assert_eq!(
|
||||
head, expected_head,
|
||||
@@ -129,10 +128,12 @@ impl ForkChoiceTestDefinition {
|
||||
justified_epoch,
|
||||
finalized_epoch,
|
||||
};
|
||||
fork_choice.process_block(block).expect(&format!(
|
||||
"process_block op at index {} returned error",
|
||||
op_index
|
||||
));
|
||||
fork_choice.process_block(block).unwrap_or_else(|e| {
|
||||
panic!(
|
||||
"process_block op at index {} returned error: {:?}",
|
||||
op_index, e
|
||||
)
|
||||
});
|
||||
check_bytes_round_trip(&fork_choice);
|
||||
}
|
||||
Operation::ProcessAttestation {
|
||||
@@ -142,10 +143,12 @@ impl ForkChoiceTestDefinition {
|
||||
} => {
|
||||
fork_choice
|
||||
.process_attestation(validator_index, block_root, target_epoch)
|
||||
.expect(&format!(
|
||||
"process_attestation op at index {} returned error",
|
||||
op_index
|
||||
));
|
||||
.unwrap_or_else(|_| {
|
||||
panic!(
|
||||
"process_attestation op at index {} returned error",
|
||||
op_index
|
||||
)
|
||||
});
|
||||
check_bytes_round_trip(&fork_choice);
|
||||
}
|
||||
Operation::Prune {
|
||||
|
||||
@@ -91,7 +91,7 @@ pub fn get_ffg_case_01_test_definition() -> ForkChoiceTestDefinition {
|
||||
justified_epoch: Epoch::new(2),
|
||||
justified_root: get_hash(3),
|
||||
finalized_epoch: Epoch::new(1),
|
||||
justified_state_balances: balances.clone(),
|
||||
justified_state_balances: balances,
|
||||
expected_head: get_hash(3),
|
||||
});
|
||||
|
||||
@@ -421,7 +421,7 @@ pub fn get_ffg_case_02_test_definition() -> ForkChoiceTestDefinition {
|
||||
justified_epoch: Epoch::new(3),
|
||||
justified_root: get_hash(2),
|
||||
finalized_epoch: Epoch::new(0),
|
||||
justified_state_balances: balances.clone(),
|
||||
justified_state_balances: balances,
|
||||
});
|
||||
|
||||
// END OF TESTS
|
||||
|
||||
@@ -212,7 +212,7 @@ pub fn get_no_votes_test_definition() -> ForkChoiceTestDefinition {
|
||||
justified_epoch: Epoch::new(2),
|
||||
justified_root: get_hash(5),
|
||||
finalized_epoch: Epoch::new(1),
|
||||
justified_state_balances: balances.clone(),
|
||||
justified_state_balances: balances,
|
||||
expected_head: get_hash(6),
|
||||
},
|
||||
];
|
||||
|
||||
@@ -673,7 +673,7 @@ pub fn get_votes_test_definition() -> ForkChoiceTestDefinition {
|
||||
justified_epoch: Epoch::new(2),
|
||||
justified_root: get_hash(5),
|
||||
finalized_epoch: Epoch::new(2),
|
||||
justified_state_balances: balances.clone(),
|
||||
justified_state_balances: balances,
|
||||
expected_head: get_hash(11),
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user