lighthouse-pulse/eth2/state_processing/src/per_epoch_processing/tests.rs

23 lines
681 B
Rust
Raw Normal View History

#![cfg(test)]
use crate::per_epoch_processing;
use env_logger::{Builder, Env};
use types::test_utils::TestingBeaconStateBuilder;
use types::*;
#[test]
fn runs_without_error() {
Builder::from_env(Env::default().default_filter_or("error")).init();
2019-05-10 04:47:09 +00:00
let spec = FewValidatorsEthSpec::spec();
2019-05-10 04:47:09 +00:00
let mut builder: TestingBeaconStateBuilder<FewValidatorsEthSpec> =
TestingBeaconStateBuilder::from_deterministic_keypairs(8, &spec);
let target_slot = (spec.genesis_epoch + 4).end_slot(spec.slots_per_epoch);
builder.teleport_to_slot(target_slot, &spec);
let (mut state, _keypairs) = builder.build();
per_epoch_processing(&mut state, &spec).unwrap();
}