Skip to content

Commit

Permalink
Use JSON header by default for /eth/v1/beacon/deposit_snapshot (#5813)
Browse files Browse the repository at this point in the history
* Fix with or

* Flip case
  • Loading branch information
chong-he authored May 20, 2024
1 parent 8006418 commit b5de925
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions beacon_node/http_api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2121,14 +2121,7 @@ pub fn serve<T: BeaconChainTypes>(
task_spawner: TaskSpawner<T::EthSpec>,
eth1_service: eth1::Service| {
task_spawner.blocking_response_task(Priority::P1, move || match accept_header {
Some(api_types::Accept::Json) | None => {
let snapshot = eth1_service.get_deposit_snapshot();
Ok(
warp::reply::json(&api_types::GenericResponse::from(snapshot))
.into_response(),
)
}
_ => eth1_service
Some(api_types::Accept::Ssz) => eth1_service
.get_deposit_snapshot()
.map(|snapshot| {
Response::builder()
Expand All @@ -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(),
)
}
})
},
);
Expand Down

0 comments on commit b5de925

Please sign in to comment.