From 6c1c6192479033ed2c6cb144bc4398e6e6a255f2 Mon Sep 17 00:00:00 2001 From: debris Date: Tue, 1 Dec 2015 20:24:33 +0100 Subject: [PATCH] extension print --- src/trie.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/trie.rs b/src/trie.rs index 7761aad35..fc4c4835a 100644 --- a/src/trie.rs +++ b/src/trie.rs @@ -97,6 +97,11 @@ impl <'a>Node<'a> { } } +//enum ValidationResult<'a> { + //Valid, + //Invalid { node: Node<'a>, depth: usize } +//} + enum Operation { New(H256, Bytes), Delete(H256), @@ -194,14 +199,14 @@ impl TrieDB { let node = Node::decoded(node); match node { Node::Leaf(slice, value) => try!(writeln!(f, "Leaf {:?}, {:?}", slice, value.pretty())), - Node::ExtensionRaw(_, ref item) => { + Node::ExtensionRaw(ref slice, ref item) => { try!(self.fmt_indent(f, deepness)); - try!(write!(f, "Extension (raw): ")); + try!(write!(f, "Extension (raw): {:?} ", slice)); try!(self.fmt_all(item, f, deepness + 1)); }, - Node::ExtensionSha3(_, sha3) => { + Node::ExtensionSha3(ref slice, sha3) => { try!(self.fmt_indent(f, deepness)); - try!(write!(f, "Extension (sha3): ")); + try!(write!(f, "Extension (sha3): {:?} ", slice)); let rlp = self.db.lookup(&H256::from_slice(sha3)).expect("sha3 not found!"); try!(self.fmt_all(rlp, f, deepness + 1)); },