Allow epoch cache with zero validators.

This commit is contained in:
Paul Hauner
2019-03-17 23:32:27 +11:00
parent 979353f136
commit 191761f356
4 changed files with 16 additions and 18 deletions

View File

@@ -3,11 +3,8 @@ use hashing::hash;
use merkle_proof::verify_merkle_proof;
use ssz::ssz_encode;
use ssz_derive::Encode;
use std::collections::HashMap;
use types::*;
pub type PublicKeyValidatorIndexHashmap = HashMap<PublicKey, u64>;
/// Indicates if a `Deposit` is valid to be included in a block in the current epoch of the given
/// state.
///

View File

@@ -14,7 +14,7 @@ pub fn process_validator_registry(state: &mut BeaconState, spec: &ChainSpec) ->
state.previous_shuffling_seed = state.current_shuffling_seed;
if should_update_validator_registry(state, spec)? {
state.update_validator_registry(spec);
state.update_validator_registry(spec)?;
state.current_shuffling_epoch = next_epoch;
state.current_shuffling_start_shard = (state.current_shuffling_start_shard
@@ -37,7 +37,7 @@ pub fn process_validator_registry(state: &mut BeaconState, spec: &ChainSpec) ->
}
}
state.process_slashings(spec);
state.process_slashings(spec)?;
state.process_exit_queue(spec);
Ok(())