From 6e1d76ed41a3cc8dd4c8e0af22cafee4156f50cc Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Thu, 2 May 2024 01:22:46 +0300 Subject: [PATCH] fmt --- beacon_node/beacon_chain/src/observed_aggregates.rs | 12 ++++++------ consensus/state_processing/src/consensus_context.rs | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/beacon_node/beacon_chain/src/observed_aggregates.rs b/beacon_node/beacon_chain/src/observed_aggregates.rs index d2204d129c9..3f18c147c83 100644 --- a/beacon_node/beacon_chain/src/observed_aggregates.rs +++ b/beacon_node/beacon_chain/src/observed_aggregates.rs @@ -107,7 +107,8 @@ impl SubsetItem for Attestation { 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), @@ -117,10 +118,11 @@ impl SubsetItem for Attestation { 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), } } @@ -130,9 +132,7 @@ impl SubsetItem for Attestation { 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(), } } diff --git a/consensus/state_processing/src/consensus_context.rs b/consensus/state_processing/src/consensus_context.rs index 69aa95cbc19..38ff9c8be2e 100644 --- a/consensus/state_processing/src/consensus_context.rs +++ b/consensus/state_processing/src/consensus_context.rs @@ -160,9 +160,10 @@ impl ConsensusContext { ) -> Result<&IndexedAttestation, BlockOperationError> { 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) {