mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Test spec invariant
This commit is contained in:
@@ -545,10 +545,12 @@ impl EthSpec for GnosisEthSpec {
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{EthSpec, GnosisEthSpec, MainnetEthSpec, MinimalEthSpec};
|
||||
use ssz_types::typenum::Unsigned;
|
||||
|
||||
fn assert_valid_spec<E: EthSpec>() {
|
||||
E::kzg_commitments_tree_depth();
|
||||
E::block_body_tree_depth();
|
||||
assert!(E::MaxValidatorsPerSlot::to_i32() >= E::MaxValidatorsPerCommittee::to_i32());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
||||
@@ -120,7 +120,8 @@ impl<E: EthSpec> IndexedAttestation<E> {
|
||||
let extended_attesting_indices: VariableList<u64, E::MaxValidatorsPerSlot> =
|
||||
VariableList::new(att.attesting_indices.to_vec())
|
||||
.expect("MaxValidatorsPerSlot must be >= MaxValidatorsPerCommittee");
|
||||
// TODO: Add test after unstable rebase https://github.com/sigp/lighthouse/blob/474c1b44863927c588dd05ab2ac0f934298398e1/consensus/types/src/eth_spec.rs#L541
|
||||
// Note a unit test in consensus/types/src/eth_spec.rs asserts this invariant for
|
||||
// all known specs
|
||||
|
||||
IndexedAttestationElectra {
|
||||
attesting_indices: extended_attesting_indices,
|
||||
|
||||
Reference in New Issue
Block a user