From 0b2f3bbf00d74cc59b17ae84fb5aee3514ec7b3d Mon Sep 17 00:00:00 2001 From: Luke Anderson Date: Fri, 13 Sep 2019 18:59:01 +1000 Subject: [PATCH] Updated another function for head_state (missing from previous commit). --- beacon_node/rest_api/src/beacon.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/beacon_node/rest_api/src/beacon.rs b/beacon_node/rest_api/src/beacon.rs index c1f49c1fc..8f4c730f9 100644 --- a/beacon_node/rest_api/src/beacon.rs +++ b/beacon_node/rest_api/src/beacon.rs @@ -127,13 +127,7 @@ pub fn get_block_root(req: Request) -> ApiR /// HTTP handler to return the `Fork` of the current head. pub fn get_fork(req: Request) -> ApiResult { let beacon_chain = get_beacon_chain_from_request::(&req)?; - let head_state = get_head_state(beacon_chain)?; - - let json: String = serde_json::to_string(&head_state.fork).map_err(|e| { - ApiError::ServerError(format!("Unable to serialize BeaconState::Fork: {:?}", e)) - })?; - - Ok(success_response(Body::from(json))) + ResponseBuilder::new(&req).body(&beacon_chain.head().beacon_state) } /// HTTP handler to return the set of validators for an `Epoch`