From c3ced280951a19781bb7620da1c6530c712c0f00 Mon Sep 17 00:00:00 2001 From: realbigsean Date: Wed, 9 Aug 2023 10:45:21 -0400 Subject: [PATCH] cargo fmt --- beacon_node/http_api/src/lib.rs | 75 ++++++++---------------- beacon_node/network/src/service/tests.rs | 3 +- 2 files changed, 27 insertions(+), 51 deletions(-) diff --git a/beacon_node/http_api/src/lib.rs b/beacon_node/http_api/src/lib.rs index 7e0fd0dce..4b95a04a4 100644 --- a/beacon_node/http_api/src/lib.rs +++ b/beacon_node/http_api/src/lib.rs @@ -1291,8 +1291,8 @@ pub fn serve( log, BroadcastValidation::default(), ) - .await - .map(|()| warp::reply().into_response()) + .await + .map(|()| warp::reply().into_response()) }) }, ); @@ -1348,7 +1348,7 @@ pub fn serve( task_spawner: TaskSpawner, chain: Arc>, network_tx: UnboundedSender>, - log: Logger| { + log: Logger| { task_spawner.spawn_async(Priority::P1, async move { match publish_blocks::publish_block( None, @@ -1358,7 +1358,7 @@ pub fn serve( log, validation_level.broadcast_validation, ) - .await + .await { Ok(()) => warp::reply().into_response(), Err(e) => match warp_utils::reject::handle_rejection(e).await { @@ -1367,7 +1367,7 @@ pub fn serve( StatusCode::INTERNAL_SERVER_ERROR, eth2::StatusCode::INTERNAL_SERVER_ERROR, ) - .into_response(), + .into_response(), }, } }) @@ -1511,27 +1511,27 @@ pub fn serve( task_spawner: TaskSpawner, chain: Arc>, network_tx: UnboundedSender>, - log: Logger| { + log: Logger| { task_spawner.spawn_async(Priority::P0, async move { - match publish_blocks::publish_blinded_block( - block_contents, - chain, - &network_tx, - log, - validation_level.broadcast_validation, - ) - .await - { - Ok(()) => warp::reply().into_response(), - Err(e) => match warp_utils::reject::handle_rejection(e).await { - Ok(reply) => reply.into_response(), - Err(_) => warp::reply::with_status( - StatusCode::INTERNAL_SERVER_ERROR, - eth2::StatusCode::INTERNAL_SERVER_ERROR, - ) - .into_response(), - }, - } + match publish_blocks::publish_blinded_block( + block_contents, + chain, + &network_tx, + log, + validation_level.broadcast_validation, + ) + .await + { + Ok(()) => warp::reply().into_response(), + Err(e) => match warp_utils::reject::handle_rejection(e).await { + Ok(reply) => reply.into_response(), + Err(_) => warp::reply::with_status( + StatusCode::INTERNAL_SERVER_ERROR, + eth2::StatusCode::INTERNAL_SERVER_ERROR, + ) + .into_response(), + }, + } }) }, ); @@ -4251,31 +4251,6 @@ pub fn serve( }, ); - // POST lighthouse/database/historical_blocks - let post_lighthouse_database_historical_blocks = database_path - .and(warp::path("historical_blocks")) - .and(warp::path::end()) - .and(warp::body::json()) - .and(task_spawner_filter.clone()) - .and(chain_filter.clone()) - .and(log_filter.clone()) - .and_then( - |blocks: Vec>>, - task_spawner: TaskSpawner, - chain: Arc>, - log: Logger| { - info!( - log, - "Importing historical blocks"; - "count" => blocks.len(), - "source" => "http_api" - ); - task_spawner.blocking_json_task(Priority::P1, move || { - database::historical_blocks(chain, blocks) - }) - }, - ); - // GET lighthouse/analysis/block_rewards let get_lighthouse_block_rewards = warp::path("lighthouse") .and(warp::path("analysis")) diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index 668041384..c9aa592d6 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -5,7 +5,8 @@ mod tests { use crate::{NetworkConfig, NetworkService}; use beacon_chain::test_utils::BeaconChainHarness; use beacon_processor::{ - BeaconProcessorChannels, BeaconProcessorSend, MAX_SCHEDULED_WORK_QUEUE_LEN, MAX_WORK_EVENT_QUEUE_LEN, + BeaconProcessorChannels, BeaconProcessorSend, MAX_SCHEDULED_WORK_QUEUE_LEN, + MAX_WORK_EVENT_QUEUE_LEN, }; use lighthouse_network::Enr; use slog::{o, Drain, Level, Logger};