mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-18 18:02:24 +00:00
core/state: fixup trie prefetcher test for new prefect func signature
This commit is contained in:
parent
754cb33b11
commit
de1422b2eb
1 changed files with 4 additions and 8 deletions
|
|
@ -53,12 +53,12 @@ func TestUseAfterTerminate(t *testing.T) {
|
||||||
prefetcher := newTriePrefetcher(db.db, db.originalRoot, "", true)
|
prefetcher := newTriePrefetcher(db.db, db.originalRoot, "", true)
|
||||||
skey := common.HexToHash("aaa")
|
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)
|
t.Errorf("Prefetch failed before terminate: %v", err)
|
||||||
}
|
}
|
||||||
prefetcher.terminate(false)
|
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)
|
t.Errorf("Prefetch succeeded after terminate: %v", err)
|
||||||
}
|
}
|
||||||
if tr := prefetcher.trie(common.Hash{}, db.originalRoot); tr == nil {
|
if tr := prefetcher.trie(common.Hash{}, db.originalRoot); tr == nil {
|
||||||
|
|
@ -90,14 +90,10 @@ func TestVerklePrefetcher(t *testing.T) {
|
||||||
fetcher := newTriePrefetcher(sdb, root, "", false)
|
fetcher := newTriePrefetcher(sdb, root, "", false)
|
||||||
|
|
||||||
// Read account
|
// Read account
|
||||||
fetcher.prefetch(common.Hash{}, root, common.Address{}, [][]byte{
|
fetcher.prefetch(common.Hash{}, root, common.Address{}, []common.Address{addr}, nil, false)
|
||||||
addr.Bytes(),
|
|
||||||
}, false)
|
|
||||||
|
|
||||||
// Read storage slot
|
// Read storage slot
|
||||||
fetcher.prefetch(crypto.Keccak256Hash(addr.Bytes()), sRoot, addr, [][]byte{
|
fetcher.prefetch(crypto.Keccak256Hash(addr.Bytes()), sRoot, addr, nil, []common.Hash{skey}, false)
|
||||||
skey.Bytes(),
|
|
||||||
}, false)
|
|
||||||
|
|
||||||
fetcher.terminate(false)
|
fetcher.terminate(false)
|
||||||
accountTrie := fetcher.trie(common.Hash{}, root)
|
accountTrie := fetcher.trie(common.Hash{}, root)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue