Remove old debugging code, fix API fault

This commit is contained in:
Paul Hauner
2020-01-27 13:45:51 +11:00
parent 4da401fd39
commit 43b0a63c73
7 changed files with 29 additions and 44 deletions

View File

@@ -1,5 +1,5 @@
use crate::response_builder::ResponseBuilder;
use crate::{ApiError, ApiResult};
use crate::ApiResult;
use beacon_chain::{BeaconChain, BeaconChainTypes};
use hyper::{Body, Request};
use std::sync::Arc;
@@ -11,8 +11,5 @@ pub fn get_fork_choice<T: BeaconChainTypes>(
req: Request<Body>,
beacon_chain: Arc<BeaconChain<T>>,
) -> ApiResult {
let json = beacon_chain.fork_choice.as_json().map_err(|e| {
ApiError::ServerError(format!("Unable to encode fork choice as JSON: {:?}", e))
})?;
ResponseBuilder::new(&req)?.body_no_ssz(&json)
ResponseBuilder::new(&req)?.body_no_ssz(&*beacon_chain.fork_choice.core_proto_array())
}