Skip to content

Commit

Permalink
remove dup method get_indexed_attestation_from_committees
Browse files Browse the repository at this point in the history
  • Loading branch information
realbigsean committed Jun 19, 2024
1 parent d67270f commit 3977b92
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 19 deletions.
2 changes: 1 addition & 1 deletion beacon_node/beacon_chain/src/attestation_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -650,7 +650,7 @@ impl<'a, T: BeaconChainTypes> IndexedAggregatedAttestation<'a, T> {
.map_err(|e| BeaconChainError::from(e).into())
}
SignedAggregateAndProof::Electra(signed_aggregate) => {
attesting_indices_electra::get_indexed_attestation_from_committees(
attesting_indices_electra::get_indexed_attestation(
&committees,
&signed_aggregate.message.aggregate,
)
Expand Down
19 changes: 1 addition & 18 deletions consensus/state_processing/src/common/get_attesting_indices.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,7 @@ pub mod attesting_indices_electra {
attestation: &AttestationElectra<E>,
) -> Result<IndexedAttestation<E>, BlockOperationError<Invalid>> {
let committees = beacon_state.get_beacon_committees_at_slot(attestation.data.slot)?;
get_indexed_attestation_from_committees(&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(),
}))
get_indexed_attestation(&committees, attestation)
}

/// Shortcut for getting the attesting indices while fetching the committee from the state's cache.
Expand Down

0 comments on commit 3977b92

Please sign in to comment.