remove dup method get_indexed_attestation_from_committees

This commit is contained in:
realbigsean
2024-06-19 13:45:47 -04:00
parent d67270f899
commit 3977b92c49
2 changed files with 2 additions and 19 deletions

View File

@@ -650,7 +650,7 @@ impl<'a, T: BeaconChainTypes> IndexedAggregatedAttestation<'a, T> {
.map_err(|e| BeaconChainError::from(e).into()) .map_err(|e| BeaconChainError::from(e).into())
} }
SignedAggregateAndProof::Electra(signed_aggregate) => { SignedAggregateAndProof::Electra(signed_aggregate) => {
attesting_indices_electra::get_indexed_attestation_from_committees( attesting_indices_electra::get_indexed_attestation(
&committees, &committees,
&signed_aggregate.message.aggregate, &signed_aggregate.message.aggregate,
) )

View File

@@ -76,24 +76,7 @@ pub mod attesting_indices_electra {
attestation: &AttestationElectra<E>, attestation: &AttestationElectra<E>,
) -> Result<IndexedAttestation<E>, BlockOperationError<Invalid>> { ) -> Result<IndexedAttestation<E>, BlockOperationError<Invalid>> {
let committees = beacon_state.get_beacon_committees_at_slot(attestation.data.slot)?; let committees = beacon_state.get_beacon_committees_at_slot(attestation.data.slot)?;
get_indexed_attestation_from_committees(&committees, attestation) get_indexed_attestation(&committees, attestation)
}
pub fn get_indexed_attestation_from_committees<E: EthSpec>(
committees: &[BeaconCommittee],
attestation: &AttestationElectra<E>,
) -> Result<IndexedAttestation<E>, BlockOperationError<Invalid>> {
let attesting_indices = get_attesting_indices::<E>(
committees,
&attestation.aggregation_bits,
&attestation.committee_bits,
)?;
Ok(IndexedAttestation::Electra(IndexedAttestationElectra {
attesting_indices: VariableList::new(attesting_indices)?,
data: attestation.data.clone(),
signature: attestation.signature.clone(),
}))
} }
/// Shortcut for getting the attesting indices while fetching the committee from the state's cache. /// Shortcut for getting the attesting indices while fetching the committee from the state's cache.