From 728c381ade8e8ad36a9d1df19a54d463241890bf Mon Sep 17 00:00:00 2001 From: tmelhao Date: Mon, 3 Jun 2024 10:03:53 +0000 Subject: [PATCH] core/types: test receipt.logs marshal with time Signed-off-by: tmelhao --- core/types/receipt_test.go | 45 +++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/core/types/receipt_test.go b/core/types/receipt_test.go index fc51eb11a5..0fc5ffca6e 100644 --- a/core/types/receipt_test.go +++ b/core/types/receipt_test.go @@ -165,21 +165,23 @@ var ( Address: common.BytesToAddress([]byte{0x11}), Topics: []common.Hash{common.HexToHash("dead"), common.HexToHash("beef")}, // derived fields: - BlockNumber: blockNumber.Uint64(), - TxHash: txs[0].Hash(), - TxIndex: 0, - BlockHash: blockHash, - Index: 0, + BlockNumber: blockNumber.Uint64(), + TxHash: txs[0].Hash(), + TxIndex: 0, + BlockHash: blockHash, + Index: 0, + BlockTimestamp: blockTime, }, { Address: common.BytesToAddress([]byte{0x01, 0x11}), Topics: []common.Hash{common.HexToHash("dead"), common.HexToHash("beef")}, // derived fields: - BlockNumber: blockNumber.Uint64(), - TxHash: txs[0].Hash(), - TxIndex: 0, - BlockHash: blockHash, - Index: 1, + BlockNumber: blockNumber.Uint64(), + TxHash: txs[0].Hash(), + TxIndex: 0, + BlockHash: blockHash, + Index: 1, + BlockTimestamp: blockTime, }, }, // derived fields: @@ -199,21 +201,23 @@ var ( Address: common.BytesToAddress([]byte{0x22}), Topics: []common.Hash{common.HexToHash("dead"), common.HexToHash("beef")}, // derived fields: - BlockNumber: blockNumber.Uint64(), - TxHash: txs[1].Hash(), - TxIndex: 1, - BlockHash: blockHash, - Index: 2, + BlockNumber: blockNumber.Uint64(), + TxHash: txs[1].Hash(), + TxIndex: 1, + BlockHash: blockHash, + Index: 2, + BlockTimestamp: blockTime, }, { Address: common.BytesToAddress([]byte{0x02, 0x22}), Topics: []common.Hash{common.HexToHash("dead"), common.HexToHash("beef")}, // derived fields: - BlockNumber: blockNumber.Uint64(), - TxHash: txs[1].Hash(), - TxIndex: 1, - BlockHash: blockHash, - Index: 3, + BlockNumber: blockNumber.Uint64(), + TxHash: txs[1].Hash(), + TxIndex: 1, + BlockHash: blockHash, + Index: 3, + BlockTimestamp: blockTime, }, }, // derived fields: @@ -523,6 +527,7 @@ func clearComputedFieldsOnLogs(logs []*Log) []*Log { cpy.TxHash = common.Hash{} cpy.TxIndex = math.MaxUint32 cpy.Index = math.MaxUint32 + cpy.BlockTimestamp = math.MaxUint32 l[i] = &cpy } return l