Skip to content

Commit 8594b43

Browse files
txhslqianhh
authored andcommitted
core/rawdb: fix TestWriteAncientHeaderChain
1 parent 8a29fb1 commit 8594b43

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/rawdb/accessors_chain_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,21 +507,22 @@ func TestWriteAncientHeaderChain(t *testing.T) {
507507
var headers []*types.Header
508508
headers = append(headers, &types.Header{
509509
Number: big.NewInt(0),
510+
Difficulty: big.NewInt(2),
510511
Extra: []byte("test block"),
511512
UncleHash: types.EmptyUncleHash,
512513
TxHash: types.EmptyTxsHash,
513514
ReceiptHash: types.EmptyReceiptsHash,
514515
})
515516
headers = append(headers, &types.Header{
516517
Number: big.NewInt(1),
518+
Difficulty: big.NewInt(2),
517519
Extra: []byte("test block"),
518520
UncleHash: types.EmptyUncleHash,
519521
TxHash: types.EmptyTxsHash,
520522
ReceiptHash: types.EmptyReceiptsHash,
521523
})
522524
// Write and verify the header in the database
523-
ptd := new(big.Int)
524-
WriteAncientHeaderChain(db, headers, ptd)
525+
WriteAncientHeaderChain(db, headers, new(big.Int))
525526

526527
for _, header := range headers {
527528
if blob := ReadHeaderRLP(db, header.Hash(), header.Number.Uint64()); len(blob) == 0 {

0 commit comments

Comments
 (0)