From bde2f0f70582cde3d2d9cd49b097ad854cf73006 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Wed, 28 Feb 2024 18:25:44 +0800 Subject: [PATCH] add accessList field only when tx.AccessList() not nil --- internal/ethapi/api_test.go | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/internal/ethapi/api_test.go b/internal/ethapi/api_test.go index 18ab34edc7..662e3da754 100644 --- a/internal/ethapi/api_test.go +++ b/internal/ethapi/api_test.go @@ -1272,11 +1272,15 @@ func TestFillBlobTransaction(t *testing.T) { func argsFromTransaction(tx *types.Transaction, from common.Address) TransactionArgs { var ( - gas = tx.Gas() - nonce = tx.Nonce() - input = tx.Data() - accessList = tx.AccessList() + gas = tx.Gas() + nonce = tx.Nonce() + input = tx.Data() + 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(), }