diff --git a/trie/bintrie/store_commit.go b/trie/bintrie/store_commit.go index 2d1b3b05b5..76e9fb365b 100644 --- a/trie/bintrie/store_commit.go +++ b/trie/bintrie/store_commit.go @@ -232,7 +232,7 @@ func (s *nodeStore) decodeNode(serialized []byte, depth int, hn common.Hash, mus // clean root means the whole subtree is clean. func (s *nodeStore) collectNodes(ref nodeRef, path []byte, flushfn nodeFlushFn, groupDepth int) error { if groupDepth < 1 || groupDepth > MaxGroupDepth { - return errors.New("groupDepth must be between 1 and 8") + return fmt.Errorf("groupDepth %d, must be between 1 and 8", groupDepth) } switch ref.Kind() { diff --git a/trie/bintrie/trie_test.go b/trie/bintrie/trie_test.go index 73aacb76c4..8b7d9e46d6 100644 --- a/trie/bintrie/trie_test.go +++ b/trie/bintrie/trie_test.go @@ -768,8 +768,9 @@ func TestGetStorageNonMembershipInternalRoot(t *testing.T) { // flushes only the root-to-leaf path. func TestCommitSkipCleanSubtrees(t *testing.T) { tr := &BinaryTrie{ - store: newNodeStore(), - tracer: trie.NewPrevalueTracer(), + store: newNodeStore(), + tracer: trie.NewPrevalueTracer(), + groupDepth: 1, } const n = 200 key := func(i int) [HashSize]byte {