Minor tidy up.

This commit is contained in:
Gav Wood 2016-01-17 22:24:42 +01:00
parent 62a0737e59
commit 9203dbdca2

View File

@ -109,7 +109,12 @@ impl<'db> TrieDB<'db> {
/// Get the root node's RLP. /// Get the root node's RLP.
fn root_node(&self) -> Node { fn root_node(&self) -> Node {
Node::decoded(self.db.lookup(&self.root).expect("Trie root not found!")) Node::decoded(self.root_data())
}
/// Get the data of the root node.
fn root_data(&self) -> &[u8] {
self.db.lookup(&self.root).expect("Trie root not found!")
} }
/// Get the root node as a `Node`. /// Get the root node as a `Node`.
@ -242,7 +247,7 @@ impl<'a> TrieDBIterator<'a> {
trail: vec![], trail: vec![],
key_nibbles: Vec::new(), key_nibbles: Vec::new(),
}; };
r.descend(db.db.lookup(&db.root).expect("Trie root not found!")); r.descend(db.root_data());
r r
} }