2019-01-24 06:05:48 +00:00
|
|
|
use self::utils::TestRig;
|
|
|
|
use beacon_chain::BeaconChain;
|
2019-01-24 00:51:48 +00:00
|
|
|
#[cfg(test)]
|
2019-01-24 06:05:48 +00:00
|
|
|
use block_producer::{test_utils::TestSigner, BlockProducer};
|
2018-12-30 01:59:24 +00:00
|
|
|
use db::{
|
|
|
|
stores::{BeaconBlockStore, BeaconStateStore},
|
|
|
|
MemoryDB,
|
|
|
|
};
|
|
|
|
use slot_clock::TestingSlotClock;
|
|
|
|
use spec::ChainSpec;
|
2019-01-24 00:51:48 +00:00
|
|
|
use std::sync::{Arc, RwLock};
|
2019-01-24 06:05:48 +00:00
|
|
|
use types::{Keypair, Validator};
|
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-24 06:05:48 +00:00
|
|
|
fn rig_can_generate_validators() {
|
|
|
|
/*
|
|
|
|
let (_db, mut chain) = in_memory_test_chain(ChainSpec::foundation());
|
|
|
|
let validators = generate_validators(2, &chain);
|
|
|
|
chain.spec = inject_validators_into_spec(chain.spec.clone(), &validators[..]);
|
|
|
|
*/
|
|
|
|
let mut rig = TestRig::new(ChainSpec::foundation());
|
|
|
|
rig.generate_validators(2);
|
2018-12-30 01:59:24 +00:00
|
|
|
}
|
|
|
|
|
2019-01-24 00:51:48 +00:00
|
|
|
/*
|
2018-12-30 01:59:24 +00:00
|
|
|
#[test]
|
|
|
|
fn it_produces() {
|
|
|
|
let (_db, mut chain) = in_memory_test_chain(ChainSpec::foundation());
|
|
|
|
let (_block, _state) = chain.produce_block().unwrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
#[test]
|
|
|
|
fn it_processes_a_block_it_produces() {
|
|
|
|
let (_db, mut chain) = in_memory_test_chain(ChainSpec::foundation());
|
|
|
|
let (block, _state) = chain.produce_block().unwrap();
|
2019-01-23 08:25:05 +00:00
|
|
|
let (outcome, new_block_hash) = chain.process_block(block).unwrap();
|
2018-12-30 01:59:24 +00:00
|
|
|
assert_eq!(outcome, BlockProcessingOutcome::Processed);
|
|
|
|
assert_eq!(chain.canonical_leaf_block, new_block_hash);
|
|
|
|
}
|
2019-01-24 00:51:48 +00:00
|
|
|
*/
|