@@ -36,6 +36,7 @@ import (
3636 "github.com/ethereum/go-ethereum/crypto"
3737 "github.com/ethereum/go-ethereum/ethdb"
3838 "github.com/ethereum/go-ethereum/params"
39+ "github.com/ethereum/go-ethereum/trie"
3940)
4041
4142// So we can deterministically seed different blockchains
@@ -681,12 +682,12 @@ func TestFastVsFullChains(t *testing.T) {
681682 }
682683 if fblock , arblock , anblock := fast .GetBlockByHash (hash ), archive .GetBlockByHash (hash ), ancient .GetBlockByHash (hash ); fblock .Hash () != arblock .Hash () || anblock .Hash () != arblock .Hash () {
683684 t .Errorf ("block #%d [%x]: block mismatch: fastdb %v, ancientdb %v, archivedb %v" , num , hash , fblock , anblock , arblock )
684- } else if types .DeriveSha (fblock .Transactions ()) != types .DeriveSha (arblock .Transactions ()) || types .DeriveSha (anblock .Transactions ()) != types .DeriveSha (arblock .Transactions ()) {
685+ } else if types .DeriveSha (fblock .Transactions (), new (trie. Trie )) != types .DeriveSha (arblock .Transactions (), new (trie. Trie )) || types .DeriveSha (anblock .Transactions (), new (trie. Trie )) != types .DeriveSha (arblock .Transactions (), new (trie. Trie )) {
685686 t .Errorf ("block #%d [%x]: transactions mismatch: fastdb %v, ancientdb %v, archivedb %v" , num , hash , fblock .Transactions (), anblock .Transactions (), arblock .Transactions ())
686687 } else if types .CalcUncleHash (fblock .Uncles ()) != types .CalcUncleHash (arblock .Uncles ()) || types .CalcUncleHash (anblock .Uncles ()) != types .CalcUncleHash (arblock .Uncles ()) {
687688 t .Errorf ("block #%d [%x]: uncles mismatch: fastdb %v, ancientdb %v, archivedb %v" , num , hash , fblock .Uncles (), anblock , arblock .Uncles ())
688689 }
689- if freceipts , anreceipts , areceipts := rawdb .ReadReceipts (fastDb , hash , * rawdb .ReadHeaderNumber (fastDb , hash ), fast .Config ()), rawdb .ReadReceipts (ancientDb , hash , * rawdb .ReadHeaderNumber (ancientDb , hash ), fast .Config ()), rawdb .ReadReceipts (archiveDb , hash , * rawdb .ReadHeaderNumber (archiveDb , hash ), fast .Config ()); types .DeriveSha (freceipts ) != types .DeriveSha (areceipts ) {
690+ if freceipts , anreceipts , areceipts := rawdb .ReadReceipts (fastDb , hash , * rawdb .ReadHeaderNumber (fastDb , hash ), fast .Config ()), rawdb .ReadReceipts (ancientDb , hash , * rawdb .ReadHeaderNumber (ancientDb , hash ), fast .Config ()), rawdb .ReadReceipts (archiveDb , hash , * rawdb .ReadHeaderNumber (archiveDb , hash ), fast .Config ()); types .DeriveSha (freceipts , new (trie. Trie )) != types .DeriveSha (areceipts , new (trie. Trie ) ) {
690691 t .Errorf ("block #%d [%x]: receipts mismatch: fastdb %v, ancientdb %v, archivedb %v" , num , hash , freceipts , anreceipts , areceipts )
691692 }
692693 }
0 commit comments