Migrate codebase across to new SlotClock API

This commit is contained in:
Paul Hauner
2019-08-29 13:25:55 +10:00
parent 7bfe02be1c
commit bcd53a8b10
8 changed files with 78 additions and 62 deletions

View File

@@ -88,8 +88,8 @@ pub fn state_root_at_slot<T: BeaconChainTypes>(
) -> Result<Hash256, ApiError> {
let head_state = &beacon_chain.head().beacon_state;
let current_slot = beacon_chain
.read_slot_clock()
.ok_or_else(|| ApiError::ServerError("Unable to read slot clock".to_string()))?;
.present_slot()
.map_err(|_| ApiError::ServerError("Unable to read slot clock".to_string()))?;
// There are four scenarios when obtaining a state for a given slot:
//