Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
eserilev committed May 1, 2024
1 parent b865d89 commit 6e1d76e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions beacon_node/beacon_chain/src/observed_aggregates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ impl<E: EthSpec> SubsetItem for Attestation<E> {
fn is_subset(&self, other: &Self::Item) -> bool {
match self {
Attestation::Base(att) => {
let aggregation_bits = BitList::from_bytes(att.aggregation_bits.clone().into_bytes()).unwrap();
let aggregation_bits =
BitList::from_bytes(att.aggregation_bits.clone().into_bytes()).unwrap();
aggregation_bits.is_subset(other)
}
Attestation::Electra(att) => att.aggregation_bits.is_subset(other),
Expand All @@ -117,10 +118,11 @@ impl<E: EthSpec> SubsetItem for Attestation<E> {
fn is_superset(&self, other: &Self::Item) -> bool {
match self {
Attestation::Base(att) => {
let aggregation_bits = BitList::from_bytes(att.aggregation_bits.clone().into_bytes()).unwrap();
let aggregation_bits =
BitList::from_bytes(att.aggregation_bits.clone().into_bytes()).unwrap();
other.is_subset(&aggregation_bits)
}
Attestation::Electra(att) => other.is_subset(&att.aggregation_bits),
Attestation::Electra(att) => other.is_subset(&att.aggregation_bits),
}
}

Expand All @@ -130,9 +132,7 @@ impl<E: EthSpec> SubsetItem for Attestation<E> {
Attestation::Base(att) => {
BitList::from_bytes(att.aggregation_bits.clone().into_bytes()).unwrap()
}
Attestation::Electra(att) => {
att.aggregation_bits.clone()
}
Attestation::Electra(att) => att.aggregation_bits.clone(),
}
}

Expand Down
7 changes: 4 additions & 3 deletions consensus/state_processing/src/consensus_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,9 +160,10 @@ impl<E: EthSpec> ConsensusContext<E> {
) -> Result<&IndexedAttestation<E>, BlockOperationError<AttestationInvalid>> {
match attestation {
Attestation::Base(attestation) => {
let extended_aggregation_bits = BitList::from_bytes(attestation.aggregation_bits.clone().into_bytes())
.map_err(BeaconStateError::from)?;

let extended_aggregation_bits =
BitList::from_bytes(attestation.aggregation_bits.clone().into_bytes())
.map_err(BeaconStateError::from)?;

let key = (attestation.data.clone(), extended_aggregation_bits);

match self.indexed_attestations.entry(key) {
Expand Down

0 comments on commit 6e1d76e

Please sign in to comment.