2019-02-26 03:27:42 +00:00
|
|
|
#![cfg(test)]
|
2019-03-06 07:57:41 +00:00
|
|
|
use crate::per_epoch_processing;
|
2019-02-26 03:27:42 +00:00
|
|
|
use env_logger::{Builder, Env};
|
2019-03-11 00:17:27 +00:00
|
|
|
use types::test_utils::TestingBeaconStateBuilder;
|
2019-02-26 03:27:42 +00:00
|
|
|
use types::*;
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn runs_without_error() {
|
|
|
|
Builder::from_env(Env::default().default_filter_or("error")).init();
|
|
|
|
|
2019-03-08 23:37:41 +00:00
|
|
|
let spec = ChainSpec::few_validators();
|
2019-02-26 03:27:42 +00:00
|
|
|
|
2019-03-12 03:39:16 +00:00
|
|
|
let mut builder = TestingBeaconStateBuilder::from_deterministic_keypairs(8, &spec);
|
2019-03-09 03:11:49 +00:00
|
|
|
|
|
|
|
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();
|
2019-02-26 03:27:42 +00:00
|
|
|
|
2019-03-08 23:37:41 +00:00
|
|
|
per_epoch_processing(&mut state, &spec).unwrap();
|
2019-02-26 03:27:42 +00:00
|
|
|
}
|