More project-wide fixes for new DB

This commit is contained in:
Paul Hauner
2019-05-21 17:45:35 +10:00
parent 058829b64d
commit b62f4477e1
8 changed files with 48 additions and 36 deletions

View File

@@ -1,5 +1,4 @@
use clap::ArgMatches;
use db::DBType;
use fork_choice::ForkChoiceAlgorithm;
use network::NetworkConfig;
use slog::error;
@@ -12,6 +11,12 @@ use types::multiaddr::ToMultiaddr;
use types::Multiaddr;
use types::{ChainSpec, EthSpec, LighthouseTestnetEthSpec};
#[derive(Debug, Clone)]
pub enum DBType {
Memory,
Disk,
}
/// Stores the client configuration for this Lighthouse instance.
#[derive(Debug, Clone)]
pub struct ClientConfig {
@@ -132,7 +137,7 @@ impl ClientConfig {
}
match args.value_of("db") {
Some("rocks") => config.db_type = DBType::RocksDB,
Some("disk") => config.db_type = DBType::Disk,
Some("memory") => config.db_type = DBType::Memory,
_ => unreachable!(), // clap prevents this.
};