Refactors ethcore to use journaldb crate (#6693)

This commit is contained in:
Dmitry Kashitsyn 2017-10-17 11:20:24 +07:00
parent e2b96e1fe0
commit c0fc83988f
14 changed files with 32 additions and 15 deletions

18
Cargo.lock generated
View File

@ -539,6 +539,7 @@ dependencies = [
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.0-a.0 (git+https://github.com/paritytech/hyper)",
"itertools 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"journaldb 0.1.0",
"kvdb 0.1.0",
"kvdb-memorydb 0.1.0",
"kvdb-rocksdb 0.1.0",
@ -772,6 +773,7 @@ dependencies = [
"hash 0.1.0",
"hashdb 0.1.0",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"journaldb 0.1.0",
"kvdb 0.1.0",
"kvdb-memorydb 0.1.0",
"libc 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1252,6 +1254,22 @@ name = "itoa"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "journaldb"
version = "0.1.0"
dependencies = [
"ethcore-bigint 0.1.3",
"ethcore-bytes 0.1.0",
"hashdb 0.1.0",
"heapsize 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"kvdb 0.1.0",
"log 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"memorydb 0.1.0",
"parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rlp 0.2.0",
"util-error 0.1.0",
]
[[package]]
name = "jsonrpc-core"
version = "8.0.0"

View File

@ -71,6 +71,7 @@ hash = { path = "../util/hash" }
triehash = { path = "../util/triehash" }
semantic_version = { path = "../util/semantic_version" }
unexpected = { path = "../util/unexpected" }
journaldb = { path = "../util/journaldb" }
[dev-dependencies]
native-contracts = { path = "native_contracts", features = ["test_contracts"] }

View File

@ -26,7 +26,8 @@ use itertools::Itertools;
use hash::keccak;
use timer::PerfTimer;
use bytes::Bytes;
use util::{Address, journaldb, DBValue};
use util::{Address, DBValue};
use journaldb;
use util_error::UtilError;
use trie::{TrieSpec, TrieFactory, Trie};
use kvdb::{KeyValueDB, DBTransaction};

View File

@ -20,7 +20,7 @@ use std::fmt::{Display, Formatter, Error as FmtError};
use mode::Mode as IpcMode;
use verification::{VerifierType, QueueConfig};
use util::journaldb;
use journaldb;
use kvdb_rocksdb::CompactionProfile;
pub use std::time::Duration;

View File

@ -20,7 +20,7 @@ use std::fmt;
use std::sync::Arc;
use bigint::prelude::U256;
use bigint::hash::H256;
use util::journaldb;
use journaldb;
use {trie, kvdb_memorydb, bytes};
use kvdb::{self, KeyValueDB};
use {state, state_db, client, executive, trace, transaction, db, spec, pod_state};

View File

@ -26,7 +26,8 @@ use hash::keccak;
use bigint::prelude::U256;
use bigint::hash::H256;
use parking_lot::RwLock;
use util::*;
use journaldb;
use util::{Address, DBValue};
use kvdb_rocksdb::{Database, DatabaseConfig};
use bytes::Bytes;
use rlp::*;

View File

@ -131,6 +131,7 @@ extern crate vm;
extern crate wasm;
extern crate ethcore_util as util;
extern crate memory_cache;
extern crate journaldb;
#[macro_use]
extern crate macros;

View File

@ -23,7 +23,7 @@ use trie::TrieDB;
use views::HeaderView;
use bloom_journal::Bloom;
use migration::{Error, Migration, Progress, Batch, Config, ErrorKind};
use util::journaldb;
use journaldb;
use bigint::hash::H256;
use trie::Trie;
use kvdb::{DBTransaction, ResultExt};

View File

@ -36,7 +36,7 @@ use util::{HashDB, DBValue};
use snappy;
use bytes::Bytes;
use parking_lot::Mutex;
use util::journaldb::{self, Algorithm, JournalDB};
use journaldb::{self, Algorithm, JournalDB};
use kvdb::KeyValueDB;
use trie::{TrieDB, TrieDBMut, Trie, TrieMut};
use rlp::{RlpStream, UntrustedRlp};

View File

@ -39,7 +39,7 @@ use bigint::hash::H256;
use parking_lot::{Mutex, RwLock, RwLockReadGuard};
use util_error::UtilError;
use bytes::Bytes;
use util::journaldb::Algorithm;
use journaldb::Algorithm;
use kvdb_rocksdb::{Database, DatabaseConfig};
use snappy;

View File

@ -670,7 +670,7 @@ impl Spec {
/// constructor.
pub fn genesis_epoch_data(&self) -> Result<Vec<u8>, String> {
use transaction::{Action, Transaction};
use util::journaldb;
use journaldb;
use kvdb_memorydb;
let genesis = self.genesis_header();

View File

@ -18,7 +18,7 @@ use std::collections::{VecDeque, HashSet};
use std::sync::Arc;
use lru_cache::LruCache;
use memory_cache::MemoryLruCache;
use util::journaldb::JournalDB;
use journaldb::JournalDB;
use kvdb::{KeyValueDB, DBTransaction};
use bigint::hash::H256;
use hashdb::HashDB;

View File

@ -32,6 +32,7 @@ ethcore-bytes = { path = "bytes" }
memorydb = { path = "memorydb" }
util-error = { path = "error" }
kvdb = { path = "kvdb" }
journaldb = { path = "journaldb" }
[dev-dependencies]
kvdb-memorydb = { path = "kvdb-memorydb" }

View File

@ -112,18 +112,12 @@ extern crate util_error as error;
#[cfg(test)]
extern crate kvdb_memorydb;
#[macro_use]
extern crate log as rlog;
pub mod misc;
pub mod overlaydb;
pub mod journaldb;
pub use misc::*;
pub use hashdb::*;
pub use memorydb::MemoryDB;
pub use overlaydb::*;
pub use journaldb::JournalDB;
/// 160-bit integer representing account address
pub type Address = bigint::hash::H160;