lighthouse/eth2/state_processing/src/per_block_processing/tests.rs

24 lines
680 B
Rust
Raw Normal View History

2019-04-10 04:42:31 +00:00
#![cfg(test)]
use crate::per_block_processing;
use super::block_processing_builder::BlockProcessingBuilder;
use types::*;
pub const VALIDATOR_COUNT: usize = 10;
#[test]
fn runs_without_error() {
let spec = ChainSpec::foundation();
let mut builder = BlockProcessingBuilder::new(VALIDATOR_COUNT, &spec);
// Set the state and block to be in the last slot of the 4th epoch.
let last_slot_of_epoch = (spec.genesis_epoch + 4).end_slot(spec.slots_per_epoch);
builder.set_slot(last_slot_of_epoch, &spec);
builder.build_caches(&spec);
let (block, mut state) = builder.build(&spec);
per_block_processing(&mut state, &block, &spec).unwrap();
}