From 34cea6d1c3b1bcec6bbe9a635009a0bb3af18a39 Mon Sep 17 00:00:00 2001 From: Diva M Date: Wed, 15 Mar 2023 12:37:53 -0500 Subject: [PATCH] fmt --- beacon_node/http_api/src/lib.rs | 4 ++-- consensus/types/src/lib.rs | 7 +++++-- consensus/types/src/signed_blob.rs | 2 +- consensus/types/src/signed_block_contents.rs | 19 ++++++++++++++----- validator_client/src/block_service.rs | 5 ++++- 5 files changed, 26 insertions(+), 11 deletions(-) diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 04cb11cd0..7ac23a9d9 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -57,9 +57,9 @@ use types::{ Attestation, AttestationData, AttesterSlashing, BeaconStateError, BlindedPayload, CommitteeCache, ConfigAndPreset, Epoch, EthSpec, ForkName, FullPayload, ProposerPreparationData, ProposerSlashing, RelativeEpoch, SignedAggregateAndProof, - SignedBeaconBlock, SignedBlindedBeaconBlock, SignedBlsToExecutionChange, + SignedBeaconBlock, SignedBlindedBeaconBlock, SignedBlockContents, SignedBlsToExecutionChange, SignedContributionAndProof, SignedValidatorRegistrationData, SignedVoluntaryExit, Slot, - SyncCommitteeMessage, SyncContributionData, SignedBlockContents, + SyncCommitteeMessage, SyncContributionData, }; use version::{ add_consensus_version_header, execution_optimistic_fork_versioned_response, diff --git a/consensus/types/src/lib.rs b/consensus/types/src/lib.rs index 1c6f0b9ef..14f06bb51 100644 --- a/consensus/types/src/lib.rs +++ b/consensus/types/src/lib.rs @@ -102,8 +102,8 @@ pub mod blob_sidecar; pub mod blobs_sidecar; pub mod signed_blob; pub mod signed_block_and_blobs; -pub mod transaction; pub mod signed_block_contents; +pub mod transaction; use ethereum_types::{H160, H256}; @@ -184,7 +184,10 @@ pub use crate::signed_beacon_block::{ }; pub use crate::signed_beacon_block_header::SignedBeaconBlockHeader; pub use crate::signed_blob::*; -pub use crate::signed_block_and_blobs::{SignedBeaconBlockAndBlobsSidecar, SignedBeaconBlockAndBlobsSidecarDecode, SignedBeaconBlockAndBlobSidecars}; +pub use crate::signed_block_and_blobs::{ + SignedBeaconBlockAndBlobSidecars, SignedBeaconBlockAndBlobsSidecar, + SignedBeaconBlockAndBlobsSidecarDecode, +}; pub use crate::signed_block_contents::SignedBlockContents; pub use crate::signed_bls_to_execution_change::SignedBlsToExecutionChange; pub use crate::signed_contribution_and_proof::SignedContributionAndProof; diff --git a/consensus/types/src/signed_blob.rs b/consensus/types/src/signed_blob.rs index d7d2f884d..4121b8b7f 100644 --- a/consensus/types/src/signed_blob.rs +++ b/consensus/types/src/signed_blob.rs @@ -1,9 +1,9 @@ use crate::{test_utils::TestRandom, BlobSidecar, EthSpec, Signature}; +use derivative::Derivative; use serde_derive::{Deserialize, Serialize}; use ssz_derive::{Decode, Encode}; use test_random_derive::TestRandom; use tree_hash_derive::TreeHash; -use derivative::Derivative; #[derive( Debug, diff --git a/consensus/types/src/signed_block_contents.rs b/consensus/types/src/signed_block_contents.rs index a6743c60f..bce623333 100644 --- a/consensus/types/src/signed_block_contents.rs +++ b/consensus/types/src/signed_block_contents.rs @@ -1,5 +1,5 @@ -use crate::{AbstractExecPayload, EthSpec, FullPayload, SignedBeaconBlock, SignedBlobSidecar}; use crate::signed_block_and_blobs::SignedBeaconBlockAndBlobSidecars; +use crate::{AbstractExecPayload, EthSpec, FullPayload, SignedBeaconBlock, SignedBlobSidecar}; use derivative::Derivative; use serde_derive::{Deserialize, Serialize}; use ssz_types::VariableList; @@ -17,12 +17,19 @@ pub enum SignedBlockContents = FullP impl> SignedBlockContents { pub fn signed_block(&self) -> &SignedBeaconBlock { match self { - SignedBlockContents::BlockAndBlobSidecars(block_and_sidecars) => &block_and_sidecars.signed_block, + SignedBlockContents::BlockAndBlobSidecars(block_and_sidecars) => { + &block_and_sidecars.signed_block + } SignedBlockContents::Block(block) => block, } } - pub fn deconstruct(self) -> (SignedBeaconBlock, Option, ::MaxBlobsPerBlock>>) { + pub fn deconstruct( + self, + ) -> ( + SignedBeaconBlock, + Option, ::MaxBlobsPerBlock>>, + ) { match self { SignedBlockContents::BlockAndBlobSidecars(block_and_sidecars) => ( block_and_sidecars.signed_block, @@ -33,8 +40,10 @@ impl> SignedBlockContents> From> for SignedBlockContents { +impl> From> + for SignedBlockContents +{ fn from(block: SignedBeaconBlock) -> Self { SignedBlockContents::Block(block) } -} \ No newline at end of file +} diff --git a/validator_client/src/block_service.rs b/validator_client/src/block_service.rs index 0cc0e40a1..eb40dee9b 100644 --- a/validator_client/src/block_service.rs +++ b/validator_client/src/block_service.rs @@ -14,7 +14,10 @@ use std::sync::Arc; use std::time::Duration; use tokio::sync::mpsc; use tokio::time::sleep; -use types::{AbstractExecPayload, BeaconBlock, BlindedPayload, BlockType, EthSpec, FullPayload, Graffiti, PublicKeyBytes, SignedBlockContents, Slot}; +use types::{ + AbstractExecPayload, BeaconBlock, BlindedPayload, BlockType, EthSpec, FullPayload, Graffiti, + PublicKeyBytes, SignedBlockContents, Slot, +}; #[derive(Debug)] pub enum BlockError {