mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-19 11:20:45 +00:00
fix one panic in tests
This commit is contained in:
parent
9b7bcc3692
commit
6e35fb3b27
2 changed files with 4 additions and 3 deletions
|
|
@ -232,7 +232,7 @@ func (s *nodeStore) decodeNode(serialized []byte, depth int, hn common.Hash, mus
|
||||||
// clean root means the whole subtree is clean.
|
// clean root means the whole subtree is clean.
|
||||||
func (s *nodeStore) collectNodes(ref nodeRef, path []byte, flushfn nodeFlushFn, groupDepth int) error {
|
func (s *nodeStore) collectNodes(ref nodeRef, path []byte, flushfn nodeFlushFn, groupDepth int) error {
|
||||||
if groupDepth < 1 || groupDepth > MaxGroupDepth {
|
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() {
|
switch ref.Kind() {
|
||||||
|
|
|
||||||
|
|
@ -770,6 +770,7 @@ func TestCommitSkipCleanSubtrees(t *testing.T) {
|
||||||
tr := &BinaryTrie{
|
tr := &BinaryTrie{
|
||||||
store: newNodeStore(),
|
store: newNodeStore(),
|
||||||
tracer: trie.NewPrevalueTracer(),
|
tracer: trie.NewPrevalueTracer(),
|
||||||
|
groupDepth: 1,
|
||||||
}
|
}
|
||||||
const n = 200
|
const n = 200
|
||||||
key := func(i int) [HashSize]byte {
|
key := func(i int) [HashSize]byte {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue