mirror of
https://github.com/sigp/lighthouse.git
synced 2026-06-29 10:54:24 +00:00
Use JSON header by default for /eth/v1/beacon/deposit_snapshot (#5813)
* Fix with or * Flip case
This commit is contained in:
@@ -2121,14 +2121,7 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
task_spawner: TaskSpawner<T::EthSpec>,
|
task_spawner: TaskSpawner<T::EthSpec>,
|
||||||
eth1_service: eth1::Service| {
|
eth1_service: eth1::Service| {
|
||||||
task_spawner.blocking_response_task(Priority::P1, move || match accept_header {
|
task_spawner.blocking_response_task(Priority::P1, move || match accept_header {
|
||||||
Some(api_types::Accept::Json) | None => {
|
Some(api_types::Accept::Ssz) => eth1_service
|
||||||
let snapshot = eth1_service.get_deposit_snapshot();
|
|
||||||
Ok(
|
|
||||||
warp::reply::json(&api_types::GenericResponse::from(snapshot))
|
|
||||||
.into_response(),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
_ => eth1_service
|
|
||||||
.get_deposit_snapshot()
|
.get_deposit_snapshot()
|
||||||
.map(|snapshot| {
|
.map(|snapshot| {
|
||||||
Response::builder()
|
Response::builder()
|
||||||
@@ -2154,6 +2147,13 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
))
|
))
|
||||||
})
|
})
|
||||||
}),
|
}),
|
||||||
|
_ => {
|
||||||
|
let snapshot = eth1_service.get_deposit_snapshot();
|
||||||
|
Ok(
|
||||||
|
warp::reply::json(&api_types::GenericResponse::from(snapshot))
|
||||||
|
.into_response(),
|
||||||
|
)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user