Merge remote-tracking branch 'origin/network-clean' into eth1-deploy

This commit is contained in:
Paul Hauner
2019-11-29 17:09:01 +11:00
13 changed files with 58 additions and 81 deletions

View File

@@ -357,11 +357,11 @@ fn eth1_block_hash_at_start_of_voting_period<T: EthSpec, S: Store>(
let slot = (state.slot / period) * period;
let prev_state_root = state
.get_state_root(slot)
.map_err(|e| Error::UnableToGetPreviousStateRoot(e))?;
.map_err(Error::UnableToGetPreviousStateRoot)?;
store
.get_state::<T>(&prev_state_root, Some(slot))
.map_err(|e| Error::StoreError(e))?
.map_err(Error::StoreError)?
.map(|state| state.eth1_data.block_hash)
.ok_or_else(|| Error::PreviousStateNotInDB(*prev_state_root))
}