mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-20 05:14:35 +00:00
Fix http api tests ci (#7943)
Co-Authored-By: Jimmy Chen <jchen.tc@gmail.com> Co-Authored-By: Michael Sproul <micsproul@gmail.com> Co-Authored-By: Michael Sproul <michael@sigmaprime.io> Co-Authored-By: hopinheimer <knmanas6@gmail.com>
This commit is contained in:
@@ -1640,16 +1640,27 @@ pub fn serve<T: BeaconChainTypes>(
|
||||
.and(warp::query::<api_types::BroadcastValidationQuery>())
|
||||
.and(warp::path::end())
|
||||
.and(warp_utils::json::json())
|
||||
.and(consensus_version_header_filter)
|
||||
.and(task_spawner_filter.clone())
|
||||
.and(chain_filter.clone())
|
||||
.and(network_tx_filter.clone())
|
||||
.then(
|
||||
move |validation_level: api_types::BroadcastValidationQuery,
|
||||
blinded_block: Arc<SignedBlindedBeaconBlock<T::EthSpec>>,
|
||||
blinded_block_json: serde_json::Value,
|
||||
consensus_version: ForkName,
|
||||
task_spawner: TaskSpawner<T::EthSpec>,
|
||||
chain: Arc<BeaconChain<T>>,
|
||||
network_tx: UnboundedSender<NetworkMessage<T::EthSpec>>| {
|
||||
task_spawner.spawn_async_with_rejection(Priority::P0, async move {
|
||||
let blinded_block =
|
||||
SignedBlindedBeaconBlock::<T::EthSpec>::context_deserialize(
|
||||
&blinded_block_json,
|
||||
consensus_version,
|
||||
)
|
||||
.map(Arc::new)
|
||||
.map_err(|e| {
|
||||
warp_utils::reject::custom_bad_request(format!("invalid JSON: {e:?}"))
|
||||
})?;
|
||||
publish_blocks::publish_blinded_block(
|
||||
blinded_block,
|
||||
chain,
|
||||
|
||||
Reference in New Issue
Block a user