2019-02-26 03:27:42 +00:00
|
|
|
#![cfg(test)]
|
2019-05-19 06:56:39 +00:00
|
|
|
use crate::per_epoch_processing::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-06-08 12:49:04 +00:00
|
|
|
let spec = MinimalEthSpec::default_spec();
|
2019-02-26 03:27:42 +00:00
|
|
|
|
2019-06-08 12:49:04 +00:00
|
|
|
let mut builder: TestingBeaconStateBuilder<MinimalEthSpec> =
|
2019-05-08 06:35:22 +00:00
|
|
|
TestingBeaconStateBuilder::from_deterministic_keypairs(8, &spec);
|
2019-03-09 03:11:49 +00:00
|
|
|
|
2019-06-08 12:49:04 +00:00
|
|
|
let target_slot =
|
|
|
|
(MinimalEthSpec::genesis_epoch() + 4).end_slot(MinimalEthSpec::slots_per_epoch());
|
2019-06-09 10:26:34 +00:00
|
|
|
builder.teleport_to_slot(target_slot);
|
2019-03-09 03:11:49 +00:00
|
|
|
|
|
|
|
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
|
|
|
}
|