Allow test_harness to load validators from file

Also adds a command to test_harness binary to generate validators
This commit is contained in:
Paul Hauner
2019-03-08 13:18:02 +11:00
parent 2f484db82c
commit ec9e0bbddf
9 changed files with 174 additions and 11 deletions

View File

@@ -6,6 +6,7 @@ use beacon_chain::CheckPoint;
use bls::{create_proof_of_possession, get_withdrawal_credentials};
use log::{info, warn};
use ssz::SignedRoot;
use std::path::Path;
use types::*;
use types::{
@@ -70,7 +71,7 @@ impl TestCase {
/// Executes the test case, returning an `ExecutionResult`.
#[allow(clippy::cyclomatic_complexity)]
pub fn execute(&self) -> ExecutionResult {
pub fn execute(&self, validators_dir: Option<&Path>) -> ExecutionResult {
let spec = self.spec();
let validator_count = self.config.deposits_for_chain_start;
let slots = self.config.num_slots;
@@ -80,7 +81,7 @@ impl TestCase {
validator_count
);
let mut harness = BeaconChainHarness::new(spec, validator_count);
let mut harness = BeaconChainHarness::new(spec, validator_count, validators_dir);
info!("Starting simulation across {} slots...", slots);