diff --git a/core/types/gen_log_json.go b/core/types/gen_log_json.go index 2b6420b705..ad7ccca8fc 100644 --- a/core/types/gen_log_json.go +++ b/core/types/gen_log_json.go @@ -22,7 +22,7 @@ func (l Log) MarshalJSON() ([]byte, error) { TxHash common.Hash `json:"transactionHash" gencodec:"required" rlp:"-"` TxIndex hexutil.Uint `json:"transactionIndex" rlp:"-"` BlockHash common.Hash `json:"blockHash" rlp:"-"` - BlockTimestamp uint64 `json:"blockTimestamp" rlp:"-"` + BlockTimestamp hexutil.Uint64 `json:"blockTimestamp" rlp:"-"` Index hexutil.Uint `json:"logIndex" rlp:"-"` Removed bool `json:"removed" rlp:"-"` } @@ -34,7 +34,7 @@ func (l Log) MarshalJSON() ([]byte, error) { enc.TxHash = l.TxHash enc.TxIndex = hexutil.Uint(l.TxIndex) enc.BlockHash = l.BlockHash - enc.BlockTimestamp = l.BlockTimestamp + enc.BlockTimestamp = hexutil.Uint64(l.BlockTimestamp) enc.Index = hexutil.Uint(l.Index) enc.Removed = l.Removed return json.Marshal(&enc) @@ -50,7 +50,7 @@ func (l *Log) UnmarshalJSON(input []byte) error { TxHash *common.Hash `json:"transactionHash" gencodec:"required" rlp:"-"` TxIndex *hexutil.Uint `json:"transactionIndex" rlp:"-"` BlockHash *common.Hash `json:"blockHash" rlp:"-"` - BlockTimestamp *uint64 `json:"blockTimestamp" rlp:"-"` + BlockTimestamp *hexutil.Uint64 `json:"blockTimestamp" rlp:"-"` Index *hexutil.Uint `json:"logIndex" rlp:"-"` Removed *bool `json:"removed" rlp:"-"` } @@ -84,7 +84,7 @@ func (l *Log) UnmarshalJSON(input []byte) error { l.BlockHash = *dec.BlockHash } if dec.BlockTimestamp != nil { - l.BlockTimestamp = *dec.BlockTimestamp + l.BlockTimestamp = uint64(*dec.BlockTimestamp) } if dec.Index != nil { l.Index = uint(*dec.Index) diff --git a/core/types/log.go b/core/types/log.go index 9d277a789e..f0e6a3a745 100644 --- a/core/types/log.go +++ b/core/types/log.go @@ -56,8 +56,9 @@ type Log struct { } type logMarshaling struct { - Data hexutil.Bytes - BlockNumber hexutil.Uint64 - TxIndex hexutil.Uint - Index hexutil.Uint + Data hexutil.Bytes + BlockNumber hexutil.Uint64 + TxIndex hexutil.Uint + BlockTimestamp hexutil.Uint64 + Index hexutil.Uint } diff --git a/internal/ethapi/testdata/eth_getBlockReceipts-block-with-blob-tx.json b/internal/ethapi/testdata/eth_getBlockReceipts-block-with-blob-tx.json index 5853724cd6..f05cdb1cfd 100644 --- a/internal/ethapi/testdata/eth_getBlockReceipts-block-with-blob-tx.json +++ b/internal/ethapi/testdata/eth_getBlockReceipts-block-with-blob-tx.json @@ -17,4 +17,4 @@ "transactionIndex": "0x0", "type": "0x3" } -] +] \ No newline at end of file diff --git a/internal/ethapi/testdata/eth_getBlockReceipts-block-with-dynamic-fee-tx.json b/internal/ethapi/testdata/eth_getBlockReceipts-block-with-dynamic-fee-tx.json index 602b25e21f..2595e38b20 100644 --- a/internal/ethapi/testdata/eth_getBlockReceipts-block-with-dynamic-fee-tx.json +++ b/internal/ethapi/testdata/eth_getBlockReceipts-block-with-dynamic-fee-tx.json @@ -15,4 +15,4 @@ "transactionIndex": "0x0", "type": "0x2" } -] +] \ No newline at end of file diff --git a/internal/ethapi/testdata/eth_getBlockReceipts-block-with-legacy-contract-call-tx.json b/internal/ethapi/testdata/eth_getBlockReceipts-block-with-legacy-contract-call-tx.json index 16007c58bc..d3ba5aca9b 100644 --- a/internal/ethapi/testdata/eth_getBlockReceipts-block-with-legacy-contract-call-tx.json +++ b/internal/ethapi/testdata/eth_getBlockReceipts-block-with-legacy-contract-call-tx.json @@ -20,7 +20,7 @@ "transactionHash": "0xeaf3921cbf03ba45bad4e6ab807b196ce3b2a0b5bacc355b6272fa96b11b4287", "transactionIndex": "0x0", "blockHash": "0xcc6225bf39327429a3d869af71182d619a354155187d0b5a8ecd6a9309cffcaa", - "blockTimestamp": 30, + "blockTimestamp": "0x1e", "logIndex": "0x0", "removed": false } diff --git a/internal/ethapi/testdata/eth_getBlockReceipts-tag-latest.json b/internal/ethapi/testdata/eth_getBlockReceipts-tag-latest.json index 5853724cd6..f05cdb1cfd 100644 --- a/internal/ethapi/testdata/eth_getBlockReceipts-tag-latest.json +++ b/internal/ethapi/testdata/eth_getBlockReceipts-tag-latest.json @@ -17,4 +17,4 @@ "transactionIndex": "0x0", "type": "0x3" } -] +] \ No newline at end of file diff --git a/internal/ethapi/testdata/eth_getTransactionReceipt-blob-tx.json b/internal/ethapi/testdata/eth_getTransactionReceipt-blob-tx.json index 386f1225e6..d450e7c0d9 100644 --- a/internal/ethapi/testdata/eth_getTransactionReceipt-blob-tx.json +++ b/internal/ethapi/testdata/eth_getTransactionReceipt-blob-tx.json @@ -15,4 +15,4 @@ "transactionHash": "0x80348f994fb5f3b05bd2e5f58bbdc73485e449c028612a2c0680f9ac6ff70add", "transactionIndex": "0x0", "type": "0x3" -} +} \ No newline at end of file diff --git a/internal/ethapi/testdata/eth_getTransactionReceipt-create-contract-with-access-list.json b/internal/ethapi/testdata/eth_getTransactionReceipt-create-contract-with-access-list.json index 0519ae1da4..477c45c274 100644 --- a/internal/ethapi/testdata/eth_getTransactionReceipt-create-contract-with-access-list.json +++ b/internal/ethapi/testdata/eth_getTransactionReceipt-create-contract-with-access-list.json @@ -13,4 +13,4 @@ "transactionHash": "0x173dffc76966c72542560c376ce512a871e31b86988f9169bf021da0937640f9", "transactionIndex": "0x0", "type": "0x1" -} +} \ No newline at end of file diff --git a/internal/ethapi/testdata/eth_getTransactionReceipt-dynamic-tx-with-logs.json b/internal/ethapi/testdata/eth_getTransactionReceipt-dynamic-tx-with-logs.json index 4601273a51..a0c93a962f 100644 --- a/internal/ethapi/testdata/eth_getTransactionReceipt-dynamic-tx-with-logs.json +++ b/internal/ethapi/testdata/eth_getTransactionReceipt-dynamic-tx-with-logs.json @@ -13,4 +13,4 @@ "transactionHash": "0xdcde2574628c9d7dff22b9afa19f235959a924ceec65a9df903a517ae91f5c84", "transactionIndex": "0x0", "type": "0x2" -} +} \ No newline at end of file diff --git a/internal/ethapi/testdata/eth_getTransactionReceipt-with-logs.json b/internal/ethapi/testdata/eth_getTransactionReceipt-with-logs.json index 3615f079e8..7bd4360666 100644 --- a/internal/ethapi/testdata/eth_getTransactionReceipt-with-logs.json +++ b/internal/ethapi/testdata/eth_getTransactionReceipt-with-logs.json @@ -19,7 +19,7 @@ "transactionHash": "0xeaf3921cbf03ba45bad4e6ab807b196ce3b2a0b5bacc355b6272fa96b11b4287", "transactionIndex": "0x0", "blockHash": "0xcc6225bf39327429a3d869af71182d619a354155187d0b5a8ecd6a9309cffcaa", - "blockTimestamp": 30, + "blockTimestamp": "0x1e", "logIndex": "0x0", "removed": false }