Rename db crate to store

This commit is contained in:
Paul Hauner
2019-05-21 18:20:23 +10:00
parent 29427cf0e6
commit 3bcf5ba706
30 changed files with 76 additions and 90 deletions

View File

@@ -1,14 +1,18 @@
pub use crate::{BeaconChain, BeaconChainError, CheckPoint};
use db::MemoryDB;
use fork_choice::BitwiseLMDGhost;
use slot_clock::TestingSlotClock;
use std::sync::Arc;
use store::MemoryStore;
use tree_hash::TreeHash;
use types::*;
use types::{test_utils::TestingBeaconStateBuilder, EthSpec, FewValidatorsEthSpec};
type TestingBeaconChain<E> =
BeaconChain<MemoryDB, TestingSlotClock, BitwiseLMDGhost<MemoryDB, FewValidatorsEthSpec>, E>;
type TestingBeaconChain<E> = BeaconChain<
MemoryStore,
TestingSlotClock,
BitwiseLMDGhost<MemoryStore, FewValidatorsEthSpec>,
E,
>;
pub struct TestingBeaconChainBuilder<E: EthSpec> {
state_builder: TestingBeaconStateBuilder<E>,
@@ -16,7 +20,7 @@ pub struct TestingBeaconChainBuilder<E: EthSpec> {
impl<E: EthSpec> TestingBeaconChainBuilder<E> {
pub fn build(self, spec: &ChainSpec) -> TestingBeaconChain<E> {
let store = Arc::new(MemoryDB::open());
let store = Arc::new(MemoryStore::open());
let slot_clock = TestingSlotClock::new(spec.genesis_slot.as_u64());
let fork_choice = BitwiseLMDGhost::new(store.clone());