From 8cf9ed0ea588e97f2baf0f834248727e8fbca18f Mon Sep 17 00:00:00 2001 From: obscuren Date: Fri, 21 Nov 2014 10:48:07 -0500 Subject: [PATCH] Fixed test --- ptrie/trie.go | 3 ++- ptrie/trie_test.go | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ptrie/trie.go b/ptrie/trie.go index 7701966e5d..9fe9ea52a5 100644 --- a/ptrie/trie.go +++ b/ptrie/trie.go @@ -3,6 +3,7 @@ package ptrie import ( "bytes" "container/list" + "fmt" "sync" "github.com/ethereum/go-ethereum/crypto" @@ -198,7 +199,7 @@ func (self *Trie) get(node Node, key []byte) Node { case *FullNode: return self.get(node.branch(key[0]), key[1:]) default: - panic("Invalid node") + panic(fmt.Sprintf("%T: invalid node: %v", node, node)) } } diff --git a/ptrie/trie_test.go b/ptrie/trie_test.go index ba50f50a51..5b1c641401 100644 --- a/ptrie/trie_test.go +++ b/ptrie/trie_test.go @@ -215,13 +215,13 @@ func TestOutput(t *testing.T) { for i := 0; i < 50; i++ { trie.UpdateString(fmt.Sprintf("%s%d", base, i), "valueeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee") } - trie.Hash() fmt.Println("############################## FULL ################################") fmt.Println(trie.root) + trie.Commit() + fmt.Println("############################## SMALL ################################") trie2 := New(trie.roothash, trie.cache.backend) trie2.GetString(base + "20") - fmt.Println("############################## SMALL ################################") fmt.Println(trie2.root) }