From f790c22123cdc1325ea4d26ca1f70c6a40b51c64 Mon Sep 17 00:00:00 2001 From: Eitan Seri-Levi Date: Mon, 10 Feb 2025 00:37:04 +0200 Subject: [PATCH] fmt --- beacon_node/http_api/src/inclusion_list_duties.rs | 4 +--- beacon_node/http_api/tests/tests.rs | 8 ++++++-- validator_client/validator_services/src/duties_service.rs | 2 +- .../validator_services/src/inclusion_list_service.rs | 8 ++++++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/beacon_node/http_api/src/inclusion_list_duties.rs b/beacon_node/http_api/src/inclusion_list_duties.rs index 33d9ee43d7..f998ecaaef 100644 --- a/beacon_node/http_api/src/inclusion_list_duties.rs +++ b/beacon_node/http_api/src/inclusion_list_duties.rs @@ -12,9 +12,7 @@ pub fn inclusion_list_duties( request_indices: &[u64], chain: &BeaconChain, ) -> Result { - let current_epoch = chain - .epoch() - .map_err(warp_utils::reject::unhandled_error)?; + let current_epoch = chain.epoch().map_err(warp_utils::reject::unhandled_error)?; // Determine what the current epoch would be if we fast-forward our system clock by // `MAXIMUM_GOSSIP_CLOCK_DISPARITY`. diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index b316f2a690..ebc28123a9 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -2674,7 +2674,11 @@ impl ApiTester { let slot = self.chain.slot().unwrap(); self.harness.extend_to_slot(slot).await; for validator_indices in self.interesting_validator_indices() { - let res = self.client.post_validator_duties_inclusion_list(current_epoch, &validator_indices).await.unwrap(); + let res = self + .client + .post_validator_duties_inclusion_list(current_epoch, &validator_indices) + .await + .unwrap(); println!("{:?}", res) } self @@ -7330,7 +7334,7 @@ async fn create_signed_inclusion_lists() { } #[tokio::test(flavor = "multi_thread", worker_threads = 2)] -async fn test_post_validator_duties_inclusion_list () { +async fn test_post_validator_duties_inclusion_list() { let mut config = ApiTesterConfig::default(); config.spec.altair_fork_epoch = Some(Epoch::new(0)); config.spec.bellatrix_fork_epoch = Some(Epoch::new(0)); diff --git a/validator_client/validator_services/src/duties_service.rs b/validator_client/validator_services/src/duties_service.rs index 55eaa3221d..654dfc1754 100644 --- a/validator_client/validator_services/src/duties_service.rs +++ b/validator_client/validator_services/src/duties_service.rs @@ -339,7 +339,7 @@ impl DutiesService { let epoch = slot.epoch(E::slots_per_epoch()); if !self.spec.is_focil_enabled_for_epoch(epoch) { - return vec![] + return vec![]; } // Only collect validators that are considered safe in terms of doppelganger protection. diff --git a/validator_client/validator_services/src/inclusion_list_service.rs b/validator_client/validator_services/src/inclusion_list_service.rs index 6b59f77f95..31adbc12c7 100644 --- a/validator_client/validator_services/src/inclusion_list_service.rs +++ b/validator_client/validator_services/src/inclusion_list_service.rs @@ -113,11 +113,15 @@ impl InclusionListService { /// Spawn a new task that downloads, signs and uploads the inclusion lists to the beacon node. // TODO(focil) I don't think we need `slot_duration` here, unless we need to make some calculation // related to the freeze deadline. - fn spawn_inclusion_list_task(&self, _slot_duration: Duration, spec: &ChainSpec) -> Result<(), String> { + fn spawn_inclusion_list_task( + &self, + _slot_duration: Duration, + spec: &ChainSpec, + ) -> Result<(), String> { let slot = self.slot_clock.now().ok_or("Failed to read slot clock")?; if !spec.is_focil_enabled_for_epoch(slot.epoch(E::slots_per_epoch())) { - return Ok(()) + return Ok(()); } // TODO(focil) unused variable