Skip to content

Commit

Permalink
fix: db type should not be configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Xie committed Jan 29, 2019
1 parent 840a72e commit 6f51e93
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions db/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@ use std::path::PathBuf;
#[derive(Clone, Debug, Deserialize)]
pub struct DBConfig {
pub path: PathBuf,
pub backend: String, // "memory" or "rocksdb"
pub rocksdb: Option<HashMap<String, String>>,
}

impl Default for DBConfig {
fn default() -> Self {
DBConfig {
path: Default::default(),
backend: "rocksdb".to_owned(),
rocksdb: None,
}
}
Expand Down
2 changes: 0 additions & 2 deletions db/src/diskdb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ mod tests {
.tempdir()
.unwrap();
let config = DBConfig {
backend: "rocksdb".to_owned(),
path: tmp_dir.as_ref().to_path_buf(),
rocksdb: Some({
let mut opts = HashMap::new();
Expand All @@ -148,7 +147,6 @@ mod tests {
.tempdir()
.unwrap();
let config = DBConfig {
backend: "rocksdb".to_owned(),
path: tmp_dir.as_ref().to_path_buf(),
rocksdb: Some({
let mut opts = HashMap::new();
Expand Down
3 changes: 1 addition & 2 deletions nodes_template/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@

"data_dir": "default",
"db": {
"path": "db",
"backend": "rocksdb"
"path": "db"
},
"chain": {
"spec": "spec/dev.json"
Expand Down

0 comments on commit 6f51e93

Please sign in to comment.