mirror of
https://github.com/sigp/lighthouse.git
synced 2026-05-30 04:37:13 +00:00
Drop unused EthSpec generic from Stores (#9281)
Co-Authored-By: dapplion <35266934+dapplion@users.noreply.github.com>
This commit is contained in:
@@ -1267,8 +1267,7 @@ use {
|
||||
};
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) type TestBeaconChainType<E> =
|
||||
Witness<ManualSlotClock, E, MemoryStore<E>, MemoryStore<E>>;
|
||||
pub(crate) type TestBeaconChainType<E> = Witness<ManualSlotClock, E, MemoryStore, MemoryStore>;
|
||||
|
||||
#[cfg(test)]
|
||||
impl<E: EthSpec> NetworkBeaconProcessor<TestBeaconChainType<E>> {
|
||||
|
||||
@@ -6,7 +6,7 @@ use types::{EthSpec, Hash256};
|
||||
/// 32-byte key for accessing the `DhtEnrs`. All zero because `DhtEnrs` has its own column.
|
||||
pub const DHT_DB_KEY: Hash256 = Hash256::ZERO;
|
||||
|
||||
pub fn load_dht<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>(
|
||||
pub fn load_dht<E: EthSpec, Hot: ItemStore, Cold: ItemStore>(
|
||||
store: Arc<HotColdDB<E, Hot, Cold>>,
|
||||
) -> Vec<Enr> {
|
||||
// Load DHT from store
|
||||
@@ -20,7 +20,7 @@ pub fn load_dht<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>(
|
||||
}
|
||||
|
||||
/// Attempt to persist the ENR's in the DHT to `self.store`.
|
||||
pub fn persist_dht<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>(
|
||||
pub fn persist_dht<E: EthSpec, Hot: ItemStore, Cold: ItemStore>(
|
||||
store: Arc<HotColdDB<E, Hot, Cold>>,
|
||||
enrs: Vec<Enr>,
|
||||
) -> Result<(), store::Error> {
|
||||
@@ -28,7 +28,7 @@ pub fn persist_dht<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>(
|
||||
}
|
||||
|
||||
/// Attempts to clear any DHT entries.
|
||||
pub fn clear_dht<E: EthSpec, Hot: ItemStore<E>, Cold: ItemStore<E>>(
|
||||
pub fn clear_dht<E: EthSpec, Hot: ItemStore, Cold: ItemStore>(
|
||||
store: Arc<HotColdDB<E, Hot, Cold>>,
|
||||
) -> Result<(), store::Error> {
|
||||
store.hot_db.delete::<PersistedDht>(&DHT_DB_KEY)
|
||||
@@ -75,11 +75,8 @@ mod tests {
|
||||
use types::{ChainSpec, MinimalEthSpec};
|
||||
#[test]
|
||||
fn test_persisted_dht() {
|
||||
let store: HotColdDB<
|
||||
MinimalEthSpec,
|
||||
MemoryStore<MinimalEthSpec>,
|
||||
MemoryStore<MinimalEthSpec>,
|
||||
> = HotColdDB::open_ephemeral(StoreConfig::default(), ChainSpec::minimal().into()).unwrap();
|
||||
let store: HotColdDB<MinimalEthSpec, MemoryStore, MemoryStore> =
|
||||
HotColdDB::open_ephemeral(StoreConfig::default(), ChainSpec::minimal().into()).unwrap();
|
||||
let enrs = vec![Enr::from_str("enr:-IS4QHCYrYZbAKWCBRlAy5zzaDZXJBGkcnh4MHcBFZntXNFrdvJjX04jRzjzCBOonrkTfj499SZuOh8R33Ls8RRcy5wBgmlkgnY0gmlwhH8AAAGJc2VjcDI1NmsxoQPKY0yuDUmstAHYpMa2_oxVtw0RW_QAdpzBQA8yWM0xOIN1ZHCCdl8").unwrap()];
|
||||
store
|
||||
.put_item(&DHT_DB_KEY, &PersistedDht { enrs: enrs.clone() })
|
||||
|
||||
@@ -25,12 +25,7 @@ const SLOT_DURATION_MILLIS: u64 = 400;
|
||||
|
||||
const TEST_LOG_LEVEL: Option<&str> = None;
|
||||
|
||||
type TestBeaconChainType = Witness<
|
||||
SystemTimeSlotClock,
|
||||
MainnetEthSpec,
|
||||
MemoryStore<MainnetEthSpec>,
|
||||
MemoryStore<MainnetEthSpec>,
|
||||
>;
|
||||
type TestBeaconChainType = Witness<SystemTimeSlotClock, MainnetEthSpec, MemoryStore, MemoryStore>;
|
||||
|
||||
pub struct TestBeaconChain {
|
||||
chain: Arc<BeaconChain<TestBeaconChainType>>,
|
||||
|
||||
@@ -26,7 +26,7 @@ use types::{ForkName, Hash256, MinimalEthSpec as E, Slot};
|
||||
mod lookups;
|
||||
mod range;
|
||||
|
||||
type T = Witness<ManualSlotClock, E, MemoryStore<E>, MemoryStore<E>>;
|
||||
type T = Witness<ManualSlotClock, E, MemoryStore, MemoryStore>;
|
||||
|
||||
/// This test utility enables integration testing of Lighthouse sync components.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user