diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index a523e55bc..8ede8672e 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -1926,8 +1926,9 @@ where chain_dump .iter() .cloned() - .map(|checkpoint| checkpoint.beacon_state.finalized_checkpoint().root.into()) - .filter(|block_hash| *block_hash != Hash256::zero().into()) + .map(|checkpoint| checkpoint.beacon_state.finalized_checkpoint().root) + .filter(|block_hash| *block_hash != Hash256::zero()) + .map(|hash| hash.into()) .collect() } diff --git a/beacon_node/beacon_chain/tests/op_verification.rs b/beacon_node/beacon_chain/tests/op_verification.rs index ef62e292b..f4af49071 100644 --- a/beacon_node/beacon_chain/tests/op_verification.rs +++ b/beacon_node/beacon_chain/tests/op_verification.rs @@ -8,7 +8,6 @@ use beacon_chain::test_utils::{ }; use lazy_static::lazy_static; use sloggers::{null::NullLoggerBuilder, Build}; -use slot_clock::TestingSlotClock; use std::sync::Arc; use store::{LevelDB, StoreConfig}; use tempfile::{tempdir, TempDir}; @@ -23,7 +22,7 @@ lazy_static! { } type E = MinimalEthSpec; -type TestHarness = BeaconChainHarness>; +type TestHarness = BeaconChainHarness>; type HotColdDB = store::HotColdDB, LevelDB>; fn get_store(db_path: &TempDir) -> Arc { diff --git a/beacon_node/beacon_chain/tests/store_tests.rs b/beacon_node/beacon_chain/tests/store_tests.rs index 5b55c99d9..6718791d7 100644 --- a/beacon_node/beacon_chain/tests/store_tests.rs +++ b/beacon_node/beacon_chain/tests/store_tests.rs @@ -18,7 +18,6 @@ use lazy_static::lazy_static; use logging::test_logger; use maplit::hashset; use rand::Rng; -use slot_clock::TestingSlotClock; use state_processing::BlockReplayer; use std::collections::HashMap; use std::collections::HashSet; @@ -45,7 +44,7 @@ lazy_static! { } type E = MinimalEthSpec; -type TestHarness = BeaconChainHarness>; +type TestHarness = BeaconChainHarness>; fn get_store(db_path: &TempDir) -> Arc, LevelDB>> { get_store_with_spec(db_path, test_spec::()) @@ -2118,7 +2117,7 @@ async fn weak_subjectivity_sync() { // Initialise a new beacon chain from the finalized checkpoint let beacon_chain = Arc::new( - BeaconChainBuilder::>::new(MinimalEthSpec) + BeaconChainBuilder::>::new(MinimalEthSpec) .store(store.clone()) .custom_spec(test_spec::()) .task_executor(harness.chain.task_executor.clone()) @@ -2315,13 +2314,12 @@ async fn finalizes_after_resuming_from_db() { let original_chain = harness.chain; - let resumed_harness = - BeaconChainHarness::>::builder(MinimalEthSpec) - .default_spec() - .keypairs(KEYPAIRS[0..validator_count].to_vec()) - .resumed_disk_store(store) - .mock_execution_layer() - .build(); + let resumed_harness = BeaconChainHarness::>::builder(MinimalEthSpec) + .default_spec() + .keypairs(KEYPAIRS[0..validator_count].to_vec()) + .resumed_disk_store(store) + .mock_execution_layer() + .build(); assert_chains_pretty_much_the_same(&original_chain, &resumed_harness.chain); diff --git a/beacon_node/http_api/tests/common.rs b/beacon_node/http_api/tests/common.rs index 5cc9ab2ef..d0eabcc26 100644 --- a/beacon_node/http_api/tests/common.rs +++ b/beacon_node/http_api/tests/common.rs @@ -22,7 +22,6 @@ use logging::test_logger; use network::{NetworkReceivers, NetworkSenders}; use sensitive_url::SensitiveUrl; use slog::Logger; -use slot_clock::TestingSlotClock; use std::future::Future; use std::net::{IpAddr, Ipv4Addr, SocketAddr}; use std::sync::Arc; @@ -56,9 +55,9 @@ pub struct ApiServer> { pub external_peer_id: PeerId, } -type HarnessBuilder = Builder, TestingSlotClock>; +type HarnessBuilder = Builder>; type Initializer = Box) -> HarnessBuilder>; -type Mutator = BoxedMutator, MemoryStore, TestingSlotClock>; +type Mutator = BoxedMutator, MemoryStore>; impl InteractiveTester { pub async fn new(spec: Option, validator_count: usize) -> Self { diff --git a/beacon_node/network/src/service/tests.rs b/beacon_node/network/src/service/tests.rs index 57be233d5..a21424d7d 100644 --- a/beacon_node/network/src/service/tests.rs +++ b/beacon_node/network/src/service/tests.rs @@ -3,7 +3,7 @@ mod tests { use crate::persisted_dht::load_dht; use crate::{NetworkConfig, NetworkService}; - use beacon_chain::test_utils::{BeaconChainHarness, EphemeralHarnessType}; + use beacon_chain::test_utils::EphemeralHarnessType; use lighthouse_network::Enr; use slog::{o, Drain, Level, Logger}; use sloggers::{null::NullLoggerBuilder, Build}; @@ -12,6 +12,8 @@ mod tests { use tokio::runtime::Runtime; use types::MinimalEthSpec as E; + type BeaconChainHarness = beacon_chain::test_utils::BeaconChainHarness>; + fn get_logger(actual_log: bool) -> Logger { if actual_log { let drain = { @@ -34,7 +36,7 @@ mod tests { fn test_dht_persistence() { let log = get_logger(false); - let beacon_chain = BeaconChainHarness::EphemeralHarnessType::::builder(E) + let beacon_chain = BeaconChainHarness::builder(E) .default_spec() .deterministic_keypairs(8) .fresh_ephemeral_store() diff --git a/common/slot_clock/src/lib.rs b/common/slot_clock/src/lib.rs index 183f5c931..760b2f9cd 100644 --- a/common/slot_clock/src/lib.rs +++ b/common/slot_clock/src/lib.rs @@ -7,8 +7,8 @@ mod system_time_slot_clock; use std::time::Duration; -pub use crate::manual_slot_clock::ManualSlotClock; pub use crate::manual_slot_clock::ManualSlotClock as TestingSlotClock; +pub use crate::manual_slot_clock::ManualSlotClock; pub use crate::system_time_slot_clock::SystemTimeSlotClock; pub use metrics::scrape_for_metrics; use types::consts::merge::INTERVALS_PER_SLOT;