mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
core: check receipt block number/hash in test
This commit is contained in:
parent
bf10184c9e
commit
8a3508441a
1 changed files with 9 additions and 1 deletions
|
|
@ -145,8 +145,16 @@ func TestGeneratePOSChain(t *testing.T) {
|
|||
// Verify receipts.
|
||||
genBlockReceipts := genreceipts[i]
|
||||
for _, r := range genBlockReceipts {
|
||||
if r.BlockNumber.Cmp(block.Number()) != 0 {
|
||||
t.Errorf("receipt has wrong block number %d, want %d", r.BlockNumber, block.Number())
|
||||
}
|
||||
if r.BlockHash != block.Hash() {
|
||||
t.Errorf("receipt has wrong block hash %v, want %v", r.BlockNumber, block.Hash())
|
||||
}
|
||||
|
||||
// patch up empty logs list to make DeepEqual below work
|
||||
if r.Logs == nil {
|
||||
r.Logs = []*types.Log{} // patch up empty logs to match decoded from db
|
||||
r.Logs = []*types.Log{}
|
||||
}
|
||||
}
|
||||
blockchainReceipts := blockchain.GetReceiptsByHash(block.Hash())
|
||||
|
|
|
|||
Loading…
Reference in a new issue