pub fn is_aggregator(
        &self,
        slot: Slot,
        index: CommitteeIndex,
        slot_signature: &Signature,
        spec: &ChainSpec,
    ) -> Result<bool, Error> {
        let committee = self.get_beacon_committee(slot, index)?;
        let modulo = std::cmp::max(
            1,
            (committee.committee.len() as u64).safe_div(spec.target_aggregators_per_committee)?,
        );
        let signature_hash = hash(&slot_signature.as_ssz_bytes());
        let signature_hash_int = u64::from_le_bytes(
            signature_hash[0..8]
                .try_into()
                .expect("first 8 bytes of signature should always convert to fixed array"),
        );

        Ok(signature_hash_int.safe_rem(modulo)? == 0)
    }
/// Return `true` if the validator who produced `slot_signature` is eligible to aggregate.
///
/// Spec v0.12.1
Return `true` if the validator who produced `slot_signature` is eligible to aggregate.
Return ` true ` if the validator who produced ` slot_signature ` is eligible to aggregate .
pub fn is_aggregator(
        &self,
        slot: Slot,
        index: CommitteeIndex,
        slot_signature: &Signature,
        spec: &ChainSpec,
    ) -> Result<bool, Error> {
        let committee = self.get_beacon_committee(slot, index)?;
        let modulo = std::cmp::max(
            1,
            (committee.committee.len() as u64).safe_div(spec.target_aggregators_per_committee)?,
        );
        let signature_hash = hash(&slot_signature.as_ssz_bytes());
        let signature_hash_int = u64::from_le_bytes(
            signature_hash[0..8]
                .try_into()
                .expect("first 8 bytes of signature should always convert to fixed array"),
        );
        Ok(signature_hash_int.safe_rem(modulo)? == 0)
    }
pub fn is_aggregator ( & self , slot : Slot , index : CommitteeIndex , slot_signature : & Signature , spec : & ChainSpec , ) -> Result < bool , Error > { let committee = self . get_beacon_committee ( slot , index ) ? ; let modulo = std :: cmp :: max ( 1 , ( committee . committee . len ( ) as u64 ) . safe_div ( spec . target_aggregators_per_committee ) ? , ) ; let signature_hash = hash ( & slot_signature . as_ssz_bytes ( ) ) ; let signature_hash_int = u64 :: from_le_bytes ( signature_hash [ 0 .. 8 ] . try_into ( ) . expect ( " " ) , ) ; Ok ( signature_hash_int . safe_rem ( modulo ) ? == 0 ) }
Return `true` if the validator who produced `slot_signature` is eligible to aggregate.
Return ` true ` if the validator who produced ` slot_signature ` is eligible to aggregate .
&self
slot
Slot
index
CommitteeIndex
slot_signature
&Signature
spec
&ChainSpec