diff --git a/util/src/trie/fatdb.rs b/util/src/trie/fatdb.rs index 1b520d8ad..555e4644f 100644 --- a/util/src/trie/fatdb.rs +++ b/util/src/trie/fatdb.rs @@ -19,9 +19,10 @@ use sha3::Hashable; use hashdb::HashDB; use super::{TrieDB, Trie, TrieDBIterator, TrieError}; -/// A mutable `Trie` implementation which hashes keys and uses a generic `HashDB` backing database. +/// A `Trie` implementation which hashes keys and uses a generic `HashDB` backing database. +/// Additionaly it stores inserted hash-key mappings for later retrieval. /// -/// Use it as a `Trie` or `TrieMut` trait object. You can use `raw()` to get the backing `TrieDB` object. +/// Use it as a `Trie` or `TrieMut` trait object. pub struct FatDB<'db> { raw: TrieDB<'db>, } diff --git a/util/src/trie/fatdbmut.rs b/util/src/trie/fatdbmut.rs index b699bf208..3e72c0653 100644 --- a/util/src/trie/fatdbmut.rs +++ b/util/src/trie/fatdbmut.rs @@ -20,8 +20,9 @@ use hashdb::HashDB; use super::{TrieDBMut, Trie, TrieMut, TrieError}; /// A mutable `Trie` implementation which hashes keys and uses a generic `HashDB` backing database. +/// Additionaly it stores inserted hash-key mappings for later retrieval. /// -/// Use it as a `Trie` or `TrieMut` trait object. You can use `raw()` to get the backing `TrieDBMut` object. +/// Use it as a `Trie` or `TrieMut` trait object. pub struct FatDBMut<'db> { raw: TrieDBMut<'db>, } diff --git a/util/src/trie/mod.rs b/util/src/trie/mod.rs index 130406948..f6e731370 100644 --- a/util/src/trie/mod.rs +++ b/util/src/trie/mod.rs @@ -95,7 +95,7 @@ impl TrieFactory { } /// Create new immutable instance of Trie. - pub fn create<'db>(&self, db: &'db HashDB, root: &'db H256) -> Result, TrieError> { + pub fn readonly<'db>(&self, db: &'db HashDB, root: &'db H256) -> Result, TrieError> { match self.spec { TrieSpec::Generic => Ok(Box::new(try!(TrieDB::new(db, root)))), TrieSpec::Secure => Ok(Box::new(try!(SecTrieDB::new(db, root)))), @@ -104,7 +104,7 @@ impl TrieFactory { } /// Create new mutable instance of Trie. - pub fn create_mut<'db>(&self, db: &'db mut HashDB, root: &'db mut H256) -> Box { + pub fn create<'db>(&self, db: &'db mut HashDB, root: &'db mut H256) -> Box { match self.spec { TrieSpec::Generic => Box::new(TrieDBMut::new(db, root)), TrieSpec::Secure => Box::new(SecTrieDBMut::new(db, root)),