From 501dd0535c6af9aa03a8dd2afc47f1e40788a033 Mon Sep 17 00:00:00 2001 From: jsvisa Date: Thu, 17 Jul 2025 23:08:43 +0800 Subject: [PATCH] fix test again Signed-off-by: jsvisa --- triedb/pathdb/history_index_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/triedb/pathdb/history_index_test.go b/triedb/pathdb/history_index_test.go index 7b24b86fd6..663991a952 100644 --- a/triedb/pathdb/history_index_test.go +++ b/triedb/pathdb/history_index_test.go @@ -199,15 +199,18 @@ func TestBatchIndexerWrite(t *testing.T) { storages = make(map[common.Hash]map[common.Hash][]uint64) ) for i, h := range histories { - for _, addr := range h.accountList { + for addr := range h.accounts { addrHash := crypto.Keccak256Hash(addr.Bytes()) accounts[addrHash] = append(accounts[addrHash], uint64(i+1)) if _, ok := storages[addrHash]; !ok { storages[addrHash] = make(map[common.Hash][]uint64) } - for _, slot := range h.storageList[addr] { - storages[addrHash][slot] = append(storages[addrHash][slot], uint64(i+1)) + slots, ok := h.storages[addr] + if ok { + for slot := range slots { + storages[addrHash][slot] = append(storages[addrHash][slot], uint64(i+1)) + } } } }