Rename "TestRig" to "BeaconChainHarness"
This commit is contained in:
parent
e3115d2105
commit
1082c8857a
@ -13,7 +13,7 @@ use std::io::prelude::*;
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use types::{BeaconBlock, ChainSpec, Keypair, Validator};
|
use types::{BeaconBlock, ChainSpec, Keypair, Validator};
|
||||||
|
|
||||||
pub struct TestRig {
|
pub struct BeaconChainHarness {
|
||||||
db: Arc<MemoryDB>,
|
db: Arc<MemoryDB>,
|
||||||
beacon_chain: Arc<BeaconChain<MemoryDB, TestingSlotClock>>,
|
beacon_chain: Arc<BeaconChain<MemoryDB, TestingSlotClock>>,
|
||||||
block_store: Arc<BeaconBlockStore<MemoryDB>>,
|
block_store: Arc<BeaconBlockStore<MemoryDB>>,
|
||||||
@ -22,7 +22,7 @@ pub struct TestRig {
|
|||||||
pub spec: ChainSpec,
|
pub spec: ChainSpec,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TestRig {
|
impl BeaconChainHarness {
|
||||||
pub fn new(mut spec: ChainSpec, validator_count: usize) -> Self {
|
pub fn new(mut spec: ChainSpec, validator_count: usize) -> Self {
|
||||||
let db = Arc::new(MemoryDB::open());
|
let db = Arc::new(MemoryDB::open());
|
||||||
let block_store = Arc::new(BeaconBlockStore::new(db.clone()));
|
let block_store = Arc::new(BeaconBlockStore::new(db.clone()));
|
@ -1,11 +1,11 @@
|
|||||||
|
mod beacon_chain_harness;
|
||||||
mod benching_beacon_node;
|
mod benching_beacon_node;
|
||||||
mod direct_beacon_node;
|
mod direct_beacon_node;
|
||||||
mod direct_duties;
|
mod direct_duties;
|
||||||
mod test_rig;
|
|
||||||
mod validator;
|
mod validator;
|
||||||
|
|
||||||
|
pub use self::beacon_chain_harness::BeaconChainHarness;
|
||||||
pub use self::benching_beacon_node::BenchingBeaconNode;
|
pub use self::benching_beacon_node::BenchingBeaconNode;
|
||||||
pub use self::direct_beacon_node::DirectBeaconNode;
|
pub use self::direct_beacon_node::DirectBeaconNode;
|
||||||
pub use self::direct_duties::DirectDuties;
|
pub use self::direct_duties::DirectDuties;
|
||||||
pub use self::test_rig::TestRig;
|
|
||||||
pub use self::validator::TestValidator;
|
pub use self::validator::TestValidator;
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
use test_harness::TestRig;
|
use test_harness::BeaconChainHarness;
|
||||||
use types::ChainSpec;
|
use types::ChainSpec;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn it_can_build_on_genesis_block() {
|
fn it_can_build_on_genesis_block() {
|
||||||
let validator_count = 2;
|
let validator_count = 2;
|
||||||
let mut rig = TestRig::new(ChainSpec::foundation(), validator_count);
|
let mut rig = BeaconChainHarness::new(ChainSpec::foundation(), validator_count);
|
||||||
|
|
||||||
rig.advance_chain_with_block();
|
rig.advance_chain_with_block();
|
||||||
}
|
}
|
||||||
@ -13,7 +13,7 @@ fn it_can_build_on_genesis_block() {
|
|||||||
#[ignore]
|
#[ignore]
|
||||||
fn it_can_produce_past_first_epoch_boundary() {
|
fn it_can_produce_past_first_epoch_boundary() {
|
||||||
let validator_count = 2;
|
let validator_count = 2;
|
||||||
let mut rig = TestRig::new(ChainSpec::foundation(), validator_count);
|
let mut rig = BeaconChainHarness::new(ChainSpec::foundation(), validator_count);
|
||||||
|
|
||||||
let blocks = rig.spec.epoch_length + 1;
|
let blocks = rig.spec.epoch_length + 1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user