mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
Fix op pool tests
This commit is contained in:
@@ -666,8 +666,7 @@ mod release_tests {
|
|||||||
fn attestation_test_state<E: EthSpec>(
|
fn attestation_test_state<E: EthSpec>(
|
||||||
num_committees: usize,
|
num_committees: usize,
|
||||||
) -> (BeaconChainHarness<EphemeralHarnessType<E>>, ChainSpec) {
|
) -> (BeaconChainHarness<EphemeralHarnessType<E>>, ChainSpec) {
|
||||||
let mut spec = test_spec::<E>();
|
let spec = test_spec::<E>();
|
||||||
spec.altair_fork_epoch = Some(Epoch::new(0));
|
|
||||||
|
|
||||||
let num_validators =
|
let num_validators =
|
||||||
num_committees * E::slots_per_epoch() as usize * spec.target_committee_size;
|
num_committees * E::slots_per_epoch() as usize * spec.target_committee_size;
|
||||||
@@ -681,7 +680,6 @@ mod release_tests {
|
|||||||
num_committees: usize,
|
num_committees: usize,
|
||||||
) -> (BeaconChainHarness<EphemeralHarnessType<E>>, ChainSpec) {
|
) -> (BeaconChainHarness<EphemeralHarnessType<E>>, ChainSpec) {
|
||||||
let mut spec = E::default_spec();
|
let mut spec = E::default_spec();
|
||||||
|
|
||||||
spec.altair_fork_epoch = Some(Epoch::new(0));
|
spec.altair_fork_epoch = Some(Epoch::new(0));
|
||||||
|
|
||||||
let num_validators =
|
let num_validators =
|
||||||
@@ -747,9 +745,18 @@ mod release_tests {
|
|||||||
})
|
})
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
let att1_indices = get_attesting_indices_from_state(&state, &att1).unwrap();
|
||||||
|
let att2_indices = get_attesting_indices_from_state(&state, &att2).unwrap();
|
||||||
|
let att1_split = SplitAttestation::new(att1.clone(), att1_indices);
|
||||||
|
let att2_split = SplitAttestation::new(att2.clone(), att2_indices);
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
att1.aggregation_bits.num_set_bits(),
|
att1.aggregation_bits.num_set_bits(),
|
||||||
earliest_attestation_validators(&att1, &state, state.as_base().unwrap())
|
earliest_attestation_validators(
|
||||||
|
&att1_split.as_ref(),
|
||||||
|
&state,
|
||||||
|
state.as_base().unwrap()
|
||||||
|
)
|
||||||
.num_set_bits()
|
.num_set_bits()
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -767,7 +774,11 @@ mod release_tests {
|
|||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
committees.get(0).unwrap().committee.len() - 2,
|
committees.get(0).unwrap().committee.len() - 2,
|
||||||
earliest_attestation_validators(&att2, &state, state.as_base().unwrap())
|
earliest_attestation_validators(
|
||||||
|
&att2_split.as_ref(),
|
||||||
|
&state,
|
||||||
|
state.as_base().unwrap()
|
||||||
|
)
|
||||||
.num_set_bits()
|
.num_set_bits()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user