From b5dee527c447929859b64d3086ea368c83b34215 Mon Sep 17 00:00:00 2001 From: HAOYUatHZ <37070449+HAOYUatHZ@users.noreply.github.com> Date: Thu, 4 Jul 2024 16:03:19 +0800 Subject: [PATCH] fix l2trace `TransactionData` (#882) update `TransactionData` type --- core/types/l2trace.go | 62 ++++++++++++++++++++++++------------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/core/types/l2trace.go b/core/types/l2trace.go index 9a0f499a53..d5ef35d6a3 100644 --- a/core/types/l2trace.go +++ b/core/types/l2trace.go @@ -152,20 +152,23 @@ type StorageWrapper struct { } type TransactionData struct { - Type uint8 `json:"type"` - Nonce uint64 `json:"nonce"` - TxHash string `json:"txHash"` - Gas uint64 `json:"gas"` - GasPrice *hexutil.Big `json:"gasPrice"` - From common.Address `json:"from"` - To *common.Address `json:"to"` - ChainId *hexutil.Big `json:"chainId"` - Value *hexutil.Big `json:"value"` - Data string `json:"data"` - IsCreate bool `json:"isCreate"` - V *hexutil.Big `json:"v"` - R *hexutil.Big `json:"r"` - S *hexutil.Big `json:"s"` + Type uint8 `json:"type"` + Nonce uint64 `json:"nonce"` + TxHash string `json:"txHash"` + Gas uint64 `json:"gas"` + GasPrice *hexutil.Big `json:"gasPrice"` + GasTipCap *hexutil.Big `json:"gasTipCap"` + GasFeeCap *hexutil.Big `json:"gasFeeCap"` + From common.Address `json:"from"` + To *common.Address `json:"to"` + ChainId *hexutil.Big `json:"chainId"` + Value *hexutil.Big `json:"value"` + Data string `json:"data"` + IsCreate bool `json:"isCreate"` + AccessList AccessList `json:"accessList"` + V *hexutil.Big `json:"v"` + R *hexutil.Big `json:"r"` + S *hexutil.Big `json:"s"` } // NewTransactionData returns a transaction that will serialize to the trace @@ -181,20 +184,23 @@ func NewTransactionData(tx *Transaction, blockNumber uint64, blockTime uint64, c } result := &TransactionData{ - Type: tx.Type(), - TxHash: tx.Hash().String(), - Nonce: nonce, - ChainId: (*hexutil.Big)(tx.ChainId()), - From: from, - Gas: tx.Gas(), - GasPrice: (*hexutil.Big)(tx.GasPrice()), - To: tx.To(), - Value: (*hexutil.Big)(tx.Value()), - Data: hexutil.Encode(tx.Data()), - IsCreate: tx.To() == nil, - V: (*hexutil.Big)(v), - R: (*hexutil.Big)(r), - S: (*hexutil.Big)(s), + Type: tx.Type(), + TxHash: tx.Hash().String(), + Nonce: nonce, + ChainId: (*hexutil.Big)(tx.ChainId()), + From: from, + Gas: tx.Gas(), + GasPrice: (*hexutil.Big)(tx.GasPrice()), + GasTipCap: (*hexutil.Big)(tx.GasTipCap()), + GasFeeCap: (*hexutil.Big)(tx.GasFeeCap()), + To: tx.To(), + Value: (*hexutil.Big)(tx.Value()), + Data: hexutil.Encode(tx.Data()), + IsCreate: tx.To() == nil, + AccessList: tx.AccessList(), + V: (*hexutil.Big)(v), + R: (*hexutil.Big)(r), + S: (*hexutil.Big)(s), } return result }