Separated acquisition of BeaconChain and BeaconState.

This commit is contained in:
Luke Anderson
2019-09-12 01:44:45 +10:00
parent d9b7e684c9
commit c254ac8c2e
6 changed files with 32 additions and 39 deletions

View File

@@ -9,7 +9,7 @@ use types::EthSpec;
/// HTTP handler to return the full spec object.
pub fn get_spec<T: BeaconChainTypes + 'static>(req: Request<Body>) -> ApiResult {
let (beacon_chain, _head_state) = get_beacon_chain_from_request::<T>(&req)?;
let beacon_chain = get_beacon_chain_from_request::<T>(&req)?;
let json: String = serde_json::to_string(&beacon_chain.spec)
.map_err(|e| ApiError::ServerError(format!("Unable to serialize spec: {:?}", e)))?;