mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-08 17:26:04 +00:00
remove dup method get_indexed_attestation_from_committees
This commit is contained in:
@@ -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,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -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.
|
||||||
|
|||||||
Reference in New Issue
Block a user