copied builder and setup tests

This commit is contained in:
Darren Langley
2019-04-10 14:42:31 +10:00
parent a46f676f89
commit 3e030c78a8
2 changed files with 198 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
#![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();
}