@@ -36,6 +36,7 @@ import (
36
36
"github.com/ethereum/go-ethereum/crypto"
37
37
"github.com/ethereum/go-ethereum/ethdb"
38
38
"github.com/ethereum/go-ethereum/params"
39
+ "github.com/ethereum/go-ethereum/trie"
39
40
)
40
41
41
42
// So we can deterministically seed different blockchains
@@ -681,12 +682,12 @@ func TestFastVsFullChains(t *testing.T) {
681
682
}
682
683
if fblock , arblock , anblock := fast .GetBlockByHash (hash ), archive .GetBlockByHash (hash ), ancient .GetBlockByHash (hash ); fblock .Hash () != arblock .Hash () || anblock .Hash () != arblock .Hash () {
683
684
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 )) {
685
686
t .Errorf ("block #%d [%x]: transactions mismatch: fastdb %v, ancientdb %v, archivedb %v" , num , hash , fblock .Transactions (), anblock .Transactions (), arblock .Transactions ())
686
687
} else if types .CalcUncleHash (fblock .Uncles ()) != types .CalcUncleHash (arblock .Uncles ()) || types .CalcUncleHash (anblock .Uncles ()) != types .CalcUncleHash (arblock .Uncles ()) {
687
688
t .Errorf ("block #%d [%x]: uncles mismatch: fastdb %v, ancientdb %v, archivedb %v" , num , hash , fblock .Uncles (), anblock , arblock .Uncles ())
688
689
}
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 ) ) {
690
691
t .Errorf ("block #%d [%x]: receipts mismatch: fastdb %v, ancientdb %v, archivedb %v" , num , hash , freceipts , anreceipts , areceipts )
691
692
}
692
693
}
0 commit comments