From 0eda4a810dc703ce9aab0a616439d1d1b52a7a76 Mon Sep 17 00:00:00 2001 From: "yzb@example.cn" Date: Thu, 29 Feb 2024 15:58:07 +0800 Subject: [PATCH] test:delete-no-use-param --- eth/api_debug_test.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/eth/api_debug_test.go b/eth/api_debug_test.go index 8f46b89aa7..4c822c0012 100644 --- a/eth/api_debug_test.go +++ b/eth/api_debug_test.go @@ -36,7 +36,7 @@ import ( var dumper = spew.ConfigState{Indent: " "} -func accountRangeTest(t *testing.T, statedb *state.StateDB, start common.Hash, requestedNum int, expectedNum int) state.Dump { +func accountRangeTest(t *testing.T, trie *state.Trie, statedb *state.StateDB, start common.Hash, requestedNum int, expectedNum int) state.Dump { result := statedb.RawDump(&state.DumpConfig{ SkipCode: true, SkipStorage: true, @@ -83,10 +83,16 @@ func TestAccountRange(t *testing.T) { root, _ := sdb.Commit(0, true) sdb, _ = state.New(root, statedb, nil) + trie, err := statedb.OpenTrie(root) accountRangeTest(t, sdb, common.Hash{}, AccountRangeMaxResults/2, AccountRangeMaxResults/2) + if err != nil { + t.Fatal(err) + } + + accountRangeTest(t, &trie, sdb, common.Hash{}, AccountRangeMaxResults/2, AccountRangeMaxResults/2) // test pagination - firstResult := accountRangeTest(t, sdb, common.Hash{}, AccountRangeMaxResults, AccountRangeMaxResults) - secondResult := accountRangeTest(t, sdb, common.BytesToHash(firstResult.Next), AccountRangeMaxResults, AccountRangeMaxResults) + firstResult := accountRangeTest(t, &trie, sdb, common.Hash{}, AccountRangeMaxResults, AccountRangeMaxResults) + secondResult := accountRangeTest(t, &trie, sdb, common.BytesToHash(firstResult.Next), AccountRangeMaxResults, AccountRangeMaxResults) hList := make([]common.Hash, 0) for addr1, acc := range firstResult.Accounts {