Revert most of commit ebd97730d5.

- Undoing making of the beacon chain read stuff return futures, instead dealing with it elsewhere.
This commit is contained in:
Luke Anderson
2019-09-11 18:21:51 +10:00
parent 2739ee83f9
commit 0bd8187ff6
3 changed files with 87 additions and 76 deletions

View File

@@ -233,7 +233,7 @@ pub fn get_beacon_chain_from_request<T: BeaconChainTypes + 'static>(
let beacon_chain = req
.extensions()
.get::<Arc<BeaconChain<T>>>()
.expect("BeaconChain extension must be there, because we put it there.");
.ok_or_else(|| ApiError::ServerError("Beacon chain extension missing".into()))?;
let mut head_state = beacon_chain
.state_now()
.map_err(|e| ApiError::ServerError(format!("Unable to get current BeaconState {:?}", e)))?;