diff --git a/beacon_node/beacon_chain/tests/tests.rs b/beacon_node/beacon_chain/tests/tests.rs index a278d3f5b..6c7cfb79c 100644 --- a/beacon_node/beacon_chain/tests/tests.rs +++ b/beacon_node/beacon_chain/tests/tests.rs @@ -12,9 +12,14 @@ use beacon_chain::{ BlockProcessingOutcome, }; use rand::Rng; +use state_processing::{ + per_slot_processing, per_slot_processing::Error as SlotProcessingError, EpochProcessingError, +}; use store::Store; use types::test_utils::{SeedableRng, TestRandom, XorShiftRng}; -use types::{Deposit, EthSpec, Hash256, Keypair, MinimalEthSpec, RelativeEpoch, Slot}; +use types::{ + BeaconStateError, Deposit, EthSpec, Hash256, Keypair, MinimalEthSpec, RelativeEpoch, Slot, +}; // Should ideally be divisible by 3. pub const VALIDATOR_COUNT: usize = 24; @@ -32,6 +37,30 @@ fn get_harness(validator_count: usize) -> BeaconChainHarness continue, + Err(e) => break e, + } + }; + + assert!(state.slot > 1, "the state should skip at least one slot"); + assert_eq!( + error, + SlotProcessingError::EpochProcessingError(EpochProcessingError::BeaconStateError( + BeaconStateError::InsufficientValidators + )), + "should return error indicating that validators have been slashed out" + ) +} + #[test] fn iterators() { let num_blocks_produced = MinimalEthSpec::slots_per_epoch() * 2 - 1;