Tidy BeaconChain; del spec, unify head updates

This commit is contained in:
Paul Hauner
2019-05-31 17:32:20 +10:00
parent 8acffcc0db
commit 2f9f8bf772
4 changed files with 176 additions and 132 deletions

View File

@@ -10,6 +10,7 @@ use persistent::Read;
use router::Router;
use serde_json::json;
use std::sync::Arc;
use types::EthSpec;
/// Yields a handler for the HTTP API.
pub fn build_handler<T: BeaconChainTypes + 'static>(
@@ -64,7 +65,7 @@ fn handle_fork<T: BeaconChainTypes + 'static>(req: &mut Request) -> IronResult<R
let response = json!({
"fork": beacon_chain.head().beacon_state.fork,
"chain_id": beacon_chain.spec.chain_id
"chain_id": T::EthSpec::spec().chain_id
});
Ok(Response::with((Status::Ok, response.to_string())))