mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-11 18:04:18 +00:00
Getting regular endpoint functions to return futures.
- Wrapped endpoint functions in new into_boxfut function - Undid changes to Network API service, now returning ApiResult again. - Cleaning up of functions, and removal of success_response functions in updated endpoints. - A bunch of other clean-ups.
This commit is contained in:
@@ -191,13 +191,7 @@ pub fn get_state<T: BeaconChainTypes + 'static>(req: Request<Body>) -> ApiResult
|
||||
Ok(query) => {
|
||||
// We have *some* parameters, just check them.
|
||||
let query_params = ["root", "slot"];
|
||||
match query.first_of(&query_params) {
|
||||
Ok((k, v)) => (k, v),
|
||||
Err(e) => {
|
||||
// Wrong parameters provided, or another error, return the error.
|
||||
return Err(e);
|
||||
}
|
||||
}
|
||||
query.first_of(&query_params)?
|
||||
}
|
||||
Err(ApiError::InvalidQueryParams(_)) => {
|
||||
// No parameters provided at all, use current slot.
|
||||
|
||||
Reference in New Issue
Block a user