mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-14 10:22:38 +00:00
Further restructuring futures API.
- Adding try_future! macros where necessary - Returning ApiResult and mapping it to future instead - Upgrading POST publish block to return a future directly
This commit is contained in:
@@ -203,7 +203,7 @@ pub fn get_state<T: BeaconChainTypes + 'static>(req: Request<Body>) -> BoxFut {
|
||||
try_future!(parse_slot(&value))
|
||||
)),
|
||||
("root", value) => {
|
||||
let root = &try_future!(parse_root(&value));
|
||||
let root: &Hash256 = &try_future!(parse_root(&value));
|
||||
|
||||
let state = try_future!(try_future!(beacon_chain.store.get(root))
|
||||
.ok_or_else(|| ApiError::NotFound(format!("No state for root: {:?}", root))));
|
||||
|
||||
Reference in New Issue
Block a user