add accessList field only when tx.AccessList() not nil

This commit is contained in:
buddh0 2024-02-28 18:25:44 +08:00
parent 2a505a3e45
commit bde2f0f705

View file

@ -1275,8 +1275,12 @@ func argsFromTransaction(tx *types.Transaction, from common.Address) Transaction
gas = tx.Gas()
nonce = tx.Nonce()
input = tx.Data()
accessList = tx.AccessList()
accessList = (*types.AccessList)(nil)
txAccessList = tx.AccessList()
)
if txAccessList != nil {
accessList = &txAccessList
}
return TransactionArgs{
From: &from,
To: tx.To(),
@ -1287,7 +1291,7 @@ func argsFromTransaction(tx *types.Transaction, from common.Address) Transaction
Nonce: (*hexutil.Uint64)(&nonce),
Input: (*hexutil.Bytes)(&input),
ChainID: (*hexutil.Big)(tx.ChainId()),
AccessList: &accessList,
AccessList: accessList,
BlobFeeCap: (*hexutil.Big)(tx.BlobGasFeeCap()),
BlobHashes: tx.BlobHashes(),
}