From de1422b2eb76243909bb038c8d9882fd80abfdc0 Mon Sep 17 00:00:00 2001 From: lightclient Date: Sat, 19 Oct 2024 11:17:28 -0600 Subject: [PATCH] core/state: fixup trie prefetcher test for new prefect func signature --- core/state/trie_prefetcher_test.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/core/state/trie_prefetcher_test.go b/core/state/trie_prefetcher_test.go index 529b42d39c..d96727704c 100644 --- a/core/state/trie_prefetcher_test.go +++ b/core/state/trie_prefetcher_test.go @@ -53,12 +53,12 @@ func TestUseAfterTerminate(t *testing.T) { prefetcher := newTriePrefetcher(db.db, db.originalRoot, "", true) skey := common.HexToHash("aaa") - if err := prefetcher.prefetch(common.Hash{}, db.originalRoot, common.Address{}, [][]byte{skey.Bytes()}, false); err != nil { + if err := prefetcher.prefetch(common.Hash{}, db.originalRoot, common.Address{}, nil, []common.Hash{skey}, false); err != nil { t.Errorf("Prefetch failed before terminate: %v", err) } prefetcher.terminate(false) - if err := prefetcher.prefetch(common.Hash{}, db.originalRoot, common.Address{}, [][]byte{skey.Bytes()}, false); err == nil { + if err := prefetcher.prefetch(common.Hash{}, db.originalRoot, common.Address{}, nil, []common.Hash{skey}, false); err == nil { t.Errorf("Prefetch succeeded after terminate: %v", err) } if tr := prefetcher.trie(common.Hash{}, db.originalRoot); tr == nil { @@ -90,14 +90,10 @@ func TestVerklePrefetcher(t *testing.T) { fetcher := newTriePrefetcher(sdb, root, "", false) // Read account - fetcher.prefetch(common.Hash{}, root, common.Address{}, [][]byte{ - addr.Bytes(), - }, false) + fetcher.prefetch(common.Hash{}, root, common.Address{}, []common.Address{addr}, nil, false) // Read storage slot - fetcher.prefetch(crypto.Keccak256Hash(addr.Bytes()), sRoot, addr, [][]byte{ - skey.Bytes(), - }, false) + fetcher.prefetch(crypto.Keccak256Hash(addr.Bytes()), sRoot, addr, nil, []common.Hash{skey}, false) fetcher.terminate(false) accountTrie := fetcher.trie(common.Hash{}, root)