mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-10 04:01:51 +00:00
copied builder and setup tests
This commit is contained in:
23
eth2/state_processing/src/per_block_processing/tests.rs
Normal file
23
eth2/state_processing/src/per_block_processing/tests.rs
Normal 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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user