Skip to content

Commit

Permalink
add: accessList to 1559 tx
Browse files Browse the repository at this point in the history
  • Loading branch information
liewhite committed Dec 27, 2023
1 parent 4b583dd commit fb46403
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 4 additions & 1 deletion crypto/src/main/java/org/web3j/crypto/RawTransaction.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
package org.web3j.crypto;

import java.math.BigInteger;
import java.util.Collections;
import java.util.List;

import org.web3j.crypto.transaction.type.ITransaction;
Expand Down Expand Up @@ -115,7 +116,9 @@ public static RawTransaction createTransaction(
value,
data,
maxPriorityFeePerGas,
maxFeePerGas));
maxFeePerGas,
Collections.emptyList()
));
}

public static RawTransaction createTransaction(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@

import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.web3j.crypto.AccessListObject;
import org.web3j.crypto.Sign;
import org.web3j.rlp.RlpList;
import org.web3j.rlp.RlpString;
Expand Down Expand Up @@ -44,7 +46,8 @@ public Transaction1559(
BigInteger value,
String data,
BigInteger maxPriorityFeePerGas,
BigInteger maxFeePerGas) {
BigInteger maxFeePerGas,
List<AccessListObject> accessList) {
super(EIP1559, nonce, null, gasLimit, to, value, data);
this.chainId = chainId;
this.maxPriorityFeePerGas = maxPriorityFeePerGas;
Expand Down Expand Up @@ -103,7 +106,7 @@ public static Transaction1559 createEtherTransaction(
BigInteger maxPriorityFeePerGas,
BigInteger maxFeePerGas) {
return new Transaction1559(
chainId, nonce, gasLimit, to, value, "", maxPriorityFeePerGas, maxFeePerGas);
chainId, nonce, gasLimit, to, value, "", maxPriorityFeePerGas, maxFeePerGas, Collections.emptyList());
}

public static Transaction1559 createTransaction(
Expand All @@ -114,10 +117,11 @@ public static Transaction1559 createTransaction(
BigInteger value,
String data,
BigInteger maxPriorityFeePerGas,
BigInteger maxFeePerGas) {
BigInteger maxFeePerGas,
List<AccessListObject> accessList) {

return new Transaction1559(
chainId, nonce, gasLimit, to, value, data, maxPriorityFeePerGas, maxFeePerGas);
chainId, nonce, gasLimit, to, value, data, maxPriorityFeePerGas, maxFeePerGas, accessList);
}

@Override
Expand Down

0 comments on commit fb46403

Please sign in to comment.