diff --git a/beacon_node/beacon_chain/test_harness/src/harness.rs b/beacon_node/beacon_chain/test_harness/src/harness.rs index ee4d94148..0b493b64a 100644 --- a/beacon_node/beacon_chain/test_harness/src/harness.rs +++ b/beacon_node/beacon_chain/test_harness/src/harness.rs @@ -19,7 +19,7 @@ pub struct BeaconChainHarness { pub block_store: Arc>, pub state_store: Arc>, pub validators: Vec, - pub spec: ChainSpec, + pub spec: Arc, } impl BeaconChainHarness { @@ -74,12 +74,14 @@ impl BeaconChainHarness { .unwrap(), ); + let spec = Arc::new(spec); + debug!("Creating validator producer and attester instances..."); // Spawn the test validator instances. let validators: Vec = keypairs - .par_iter() - .map(|keypair| TestValidator::new(keypair.clone(), beacon_chain.clone(), &spec)) + .iter() + .map(|keypair| TestValidator::new(keypair.clone(), beacon_chain.clone(), spec.clone())) .collect(); debug!("Created {} TestValidators", validators.len()); diff --git a/beacon_node/beacon_chain/test_harness/src/validator/mod.rs b/beacon_node/beacon_chain/test_harness/src/validator/mod.rs index 08da1d197..018ffbc86 100644 --- a/beacon_node/beacon_chain/test_harness/src/validator/mod.rs +++ b/beacon_node/beacon_chain/test_harness/src/validator/mod.rs @@ -52,9 +52,8 @@ impl TestValidator { pub fn new( keypair: Keypair, beacon_chain: Arc>, - spec: &ChainSpec, + spec: Arc, ) -> Self { - let spec = Arc::new(spec.clone()); let slot_clock = Arc::new(TestingSlotClock::new(spec.genesis_slot)); let signer = Arc::new(TestSigner::new(keypair.clone())); let beacon_node = Arc::new(BenchingBeaconNode::new(beacon_chain.clone()));