Make genesis beacon state return a beacon state

This commit is contained in:
Paul Hauner 2019-04-17 10:33:31 +10:00
parent f69b56ad60
commit 49d066015b
No known key found for this signature in database
GPG Key ID: D362883A9218FCC6

View File

@ -15,7 +15,7 @@ pub fn get_genesis_state(
genesis_time: u64, genesis_time: u64,
genesis_eth1_data: Eth1Data, genesis_eth1_data: Eth1Data,
spec: &ChainSpec, spec: &ChainSpec,
) -> Result<(), BlockProcessingError> { ) -> Result<BeaconState, BlockProcessingError> {
// Get the genesis `BeaconState` // Get the genesis `BeaconState`
let mut state = BeaconState::genesis(genesis_time, genesis_eth1_data, spec); let mut state = BeaconState::genesis(genesis_time, genesis_eth1_data, spec);
@ -42,7 +42,7 @@ pub fn get_genesis_state(
// Generate the current shuffling seed. // Generate the current shuffling seed.
state.current_shuffling_seed = state.generate_seed(spec.genesis_epoch, spec)?; state.current_shuffling_seed = state.generate_seed(spec.genesis_epoch, spec)?;
Ok(()) Ok(state)
} }
impl From<BlockProcessingError> for GenesisError { impl From<BlockProcessingError> for GenesisError {