mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 10:52:25 +00:00
add accessList field only when tx.AccessList() not nil
This commit is contained in:
parent
2a505a3e45
commit
bde2f0f705
1 changed files with 9 additions and 5 deletions
|
|
@ -1272,11 +1272,15 @@ func TestFillBlobTransaction(t *testing.T) {
|
||||||
|
|
||||||
func argsFromTransaction(tx *types.Transaction, from common.Address) TransactionArgs {
|
func argsFromTransaction(tx *types.Transaction, from common.Address) TransactionArgs {
|
||||||
var (
|
var (
|
||||||
gas = tx.Gas()
|
gas = tx.Gas()
|
||||||
nonce = tx.Nonce()
|
nonce = tx.Nonce()
|
||||||
input = tx.Data()
|
input = tx.Data()
|
||||||
accessList = tx.AccessList()
|
accessList = (*types.AccessList)(nil)
|
||||||
|
txAccessList = tx.AccessList()
|
||||||
)
|
)
|
||||||
|
if txAccessList != nil {
|
||||||
|
accessList = &txAccessList
|
||||||
|
}
|
||||||
return TransactionArgs{
|
return TransactionArgs{
|
||||||
From: &from,
|
From: &from,
|
||||||
To: tx.To(),
|
To: tx.To(),
|
||||||
|
|
@ -1287,7 +1291,7 @@ func argsFromTransaction(tx *types.Transaction, from common.Address) Transaction
|
||||||
Nonce: (*hexutil.Uint64)(&nonce),
|
Nonce: (*hexutil.Uint64)(&nonce),
|
||||||
Input: (*hexutil.Bytes)(&input),
|
Input: (*hexutil.Bytes)(&input),
|
||||||
ChainID: (*hexutil.Big)(tx.ChainId()),
|
ChainID: (*hexutil.Big)(tx.ChainId()),
|
||||||
AccessList: &accessList,
|
AccessList: accessList,
|
||||||
BlobFeeCap: (*hexutil.Big)(tx.BlobGasFeeCap()),
|
BlobFeeCap: (*hexutil.Big)(tx.BlobGasFeeCap()),
|
||||||
BlobHashes: tx.BlobHashes(),
|
BlobHashes: tx.BlobHashes(),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue