Skip to content

Commit fb46403

Browse files
committed
add: accessList to 1559 tx
1 parent 4b583dd commit fb46403

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

crypto/src/main/java/org/web3j/crypto/RawTransaction.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
package org.web3j.crypto;
1414

1515
import java.math.BigInteger;
16+
import java.util.Collections;
1617
import java.util.List;
1718

1819
import org.web3j.crypto.transaction.type.ITransaction;
@@ -115,7 +116,9 @@ public static RawTransaction createTransaction(
115116
value,
116117
data,
117118
maxPriorityFeePerGas,
118-
maxFeePerGas));
119+
maxFeePerGas,
120+
Collections.emptyList()
121+
));
119122
}
120123

121124
public static RawTransaction createTransaction(

crypto/src/main/java/org/web3j/crypto/transaction/type/Transaction1559.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,10 @@
1414

1515
import java.math.BigInteger;
1616
import java.util.ArrayList;
17+
import java.util.Collections;
1718
import java.util.List;
1819

20+
import org.web3j.crypto.AccessListObject;
1921
import org.web3j.crypto.Sign;
2022
import org.web3j.rlp.RlpList;
2123
import org.web3j.rlp.RlpString;
@@ -44,7 +46,8 @@ public Transaction1559(
4446
BigInteger value,
4547
String data,
4648
BigInteger maxPriorityFeePerGas,
47-
BigInteger maxFeePerGas) {
49+
BigInteger maxFeePerGas,
50+
List<AccessListObject> accessList) {
4851
super(EIP1559, nonce, null, gasLimit, to, value, data);
4952
this.chainId = chainId;
5053
this.maxPriorityFeePerGas = maxPriorityFeePerGas;
@@ -103,7 +106,7 @@ public static Transaction1559 createEtherTransaction(
103106
BigInteger maxPriorityFeePerGas,
104107
BigInteger maxFeePerGas) {
105108
return new Transaction1559(
106-
chainId, nonce, gasLimit, to, value, "", maxPriorityFeePerGas, maxFeePerGas);
109+
chainId, nonce, gasLimit, to, value, "", maxPriorityFeePerGas, maxFeePerGas, Collections.emptyList());
107110
}
108111

109112
public static Transaction1559 createTransaction(
@@ -114,10 +117,11 @@ public static Transaction1559 createTransaction(
114117
BigInteger value,
115118
String data,
116119
BigInteger maxPriorityFeePerGas,
117-
BigInteger maxFeePerGas) {
120+
BigInteger maxFeePerGas,
121+
List<AccessListObject> accessList) {
118122

119123
return new Transaction1559(
120-
chainId, nonce, gasLimit, to, value, data, maxPriorityFeePerGas, maxFeePerGas);
124+
chainId, nonce, gasLimit, to, value, data, maxPriorityFeePerGas, maxFeePerGas, accessList);
121125
}
122126

123127
@Override

0 commit comments

Comments
 (0)