separated kvdb into 3 crates: kvdb, kvdb-memorydb && kvdb-rocksdb, #6693

This commit is contained in:
debris
2017-10-12 15:36:27 +02:00
parent bfff19ca9f
commit eb526b7769
60 changed files with 1106 additions and 968 deletions

View File

@@ -58,7 +58,7 @@ impl ArchiveDB {
/// Create a new instance with an anonymous temporary database.
#[cfg(test)]
fn new_temp() -> ArchiveDB {
let backing = Arc::new(::kvdb::in_memory(0));
let backing = Arc::new(::kvdb_memorydb::in_memory(0));
Self::new(backing, None)
}
@@ -211,7 +211,7 @@ mod tests {
use hashdb::{HashDB, DBValue};
use super::*;
use journaldb::traits::JournalDB;
use kvdb::Database;
use kvdb_rocksdb::Database;
use bigint::hash::H32;
#[test]

View File

@@ -143,7 +143,7 @@ impl EarlyMergeDB {
/// Create a new instance with an anonymous temporary database.
#[cfg(test)]
fn new_temp() -> EarlyMergeDB {
let backing = Arc::new(::kvdb::in_memory(0));
let backing = Arc::new(::kvdb_memorydb::in_memory(0));
Self::new(backing, None)
}
@@ -560,7 +560,7 @@ mod tests {
use super::*;
use super::super::traits::JournalDB;
use ethcore_logger::init_log;
use kvdb::{DatabaseConfig};
use kvdb_rocksdb::{DatabaseConfig};
use bigint::hash::H32;
#[test]
@@ -820,7 +820,7 @@ mod tests {
fn new_db(path: &Path) -> EarlyMergeDB {
let config = DatabaseConfig::with_columns(Some(1));
let backing = Arc::new(::kvdb::Database::open(&config, path.to_str().unwrap()).unwrap());
let backing = Arc::new(::kvdb_rocksdb::Database::open(&config, path.to_str().unwrap()).unwrap());
EarlyMergeDB::new(backing, Some(0))
}

View File

@@ -120,7 +120,7 @@ impl OverlayRecentDB {
/// Create a new instance with an anonymous temporary database.
#[cfg(test)]
pub fn new_temp() -> OverlayRecentDB {
let backing = Arc::new(::kvdb::in_memory(0));
let backing = Arc::new(::kvdb_memorydb::in_memory(0));
Self::new(backing, None)
}
@@ -468,7 +468,7 @@ mod tests {
use hashdb::{HashDB, DBValue};
use ethcore_logger::init_log;
use journaldb::JournalDB;
use kvdb::Database;
use kvdb_rocksdb::Database;
use bigint::hash::H32;
fn new_db(path: &Path) -> OverlayRecentDB {

View File

@@ -79,7 +79,7 @@ impl RefCountedDB {
/// Create a new instance with an anonymous temporary database.
#[cfg(test)]
fn new_temp() -> RefCountedDB {
let backing = Arc::new(::kvdb::in_memory(0));
let backing = Arc::new(::kvdb_memorydb::in_memory(0));
Self::new(backing, None)
}
}

View File

@@ -110,6 +110,11 @@ extern crate patricia_trie as trie;
extern crate kvdb;
extern crate util_error as error;
#[cfg(test)]
extern crate kvdb_memorydb;
#[cfg(test)]
extern crate kvdb_rocksdb;
#[macro_use]
extern crate log as rlog;

View File

@@ -50,7 +50,7 @@ impl OverlayDB {
/// Create a new instance of OverlayDB with an anonymous temporary database.
#[cfg(test)]
pub fn new_temp() -> OverlayDB {
let backing = Arc::new(::kvdb::in_memory(0));
let backing = Arc::new(::kvdb_memorydb::in_memory(0));
Self::new(backing, None)
}