2019-01-24 06:05:48 +00:00
|
|
|
use self::utils::TestRig;
|
2019-01-25 05:47:24 +00:00
|
|
|
use types::ChainSpec;
|
2019-01-24 00:51:48 +00:00
|
|
|
|
2019-01-24 06:05:48 +00:00
|
|
|
mod utils;
|
2018-12-30 01:59:24 +00:00
|
|
|
|
|
|
|
#[test]
|
2019-01-25 05:47:24 +00:00
|
|
|
fn it_can_produce_blocks() {
|
2019-01-25 00:30:06 +00:00
|
|
|
let validator_count = 2;
|
2019-01-25 05:47:24 +00:00
|
|
|
let blocks = 3;
|
2018-12-30 01:59:24 +00:00
|
|
|
|
2019-01-25 05:47:24 +00:00
|
|
|
let mut rig = TestRig::new(ChainSpec::foundation(), validator_count);
|
|
|
|
for _ in 0..blocks {
|
|
|
|
rig.produce_next_slot();
|
|
|
|
}
|
2019-01-25 20:20:58 +00:00
|
|
|
let dump = rig.chain_dump().expect("Chain dump failed.");
|
|
|
|
|
|
|
|
assert_eq!(dump.len(), blocks + 1); // + 1 for genesis block.
|
2018-12-30 01:59:24 +00:00
|
|
|
}
|