From 03ee34ac38763e60baee274207e56fc170d34cb2 Mon Sep 17 00:00:00 2001 From: Matilda Clerke Date: Wed, 29 Jan 2025 09:45:35 +1100 Subject: [PATCH] spotless Signed-off-by: Matilda Clerke --- .../AccessListTransactionEncoder.java | 38 +++++++++--------- .../CodeDelegationTransactionEncoder.java | 40 +++++++++---------- .../encoding/EIP1559TransactionEncoder.java | 24 +++++------ .../encoding/FrontierTransactionEncoder.java | 18 ++++----- 4 files changed, 60 insertions(+), 60 deletions(-) diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java index 4ed9566197e..54bf8cc41ec 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/AccessListTransactionEncoder.java @@ -31,25 +31,25 @@ public class AccessListTransactionEncoder { public static void encode(final Transaction transaction, final RLPOutput rlpOutput) { - rlpOutput.startList(); - encodeAccessListInner( - transaction.getChainId(), - transaction.getNonce(), - transaction.getGasPrice().orElseThrow(), - transaction.getGasLimit(), - transaction.getTo(), - transaction.getValue(), - transaction.getPayload(), - transaction - .getAccessList() - .orElseThrow( - () -> - new IllegalStateException( - "Developer error: access list should be guaranteed to be present")), - rlpOutput); - rlpOutput.writeIntScalar(transaction.getSignature().getRecId()); - writeSignature(transaction, rlpOutput); - rlpOutput.endList(); + rlpOutput.startList(); + encodeAccessListInner( + transaction.getChainId(), + transaction.getNonce(), + transaction.getGasPrice().orElseThrow(), + transaction.getGasLimit(), + transaction.getTo(), + transaction.getValue(), + transaction.getPayload(), + transaction + .getAccessList() + .orElseThrow( + () -> + new IllegalStateException( + "Developer error: access list should be guaranteed to be present")), + rlpOutput); + rlpOutput.writeIntScalar(transaction.getSignature().getRecId()); + writeSignature(transaction, rlpOutput); + rlpOutput.endList(); } public static void encodeAccessListInner( diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/CodeDelegationTransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/CodeDelegationTransactionEncoder.java index 1ca23eaa2c9..c34de129251 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/CodeDelegationTransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/CodeDelegationTransactionEncoder.java @@ -63,25 +63,25 @@ private static void encodeAuthorizationDetails( } public static void encode(final Transaction transaction, final RLPOutput out) { - out.startList(); - out.writeBigIntegerScalar(transaction.getChainId().orElseThrow()); - out.writeLongScalar(transaction.getNonce()); - out.writeUInt256Scalar(transaction.getMaxPriorityFeePerGas().orElseThrow()); - out.writeUInt256Scalar(transaction.getMaxFeePerGas().orElseThrow()); - out.writeLongScalar(transaction.getGasLimit()); - out.writeBytes(transaction.getTo().map(Bytes::copy).orElse(Bytes.EMPTY)); - out.writeUInt256Scalar(transaction.getValue()); - out.writeBytes(transaction.getPayload()); - writeAccessList(out, transaction.getAccessList()); - encodeCodeDelegationInner( - transaction - .getCodeDelegationList() - .orElseThrow( - () -> - new IllegalStateException( - "Developer error: the transaction should be guaranteed to have a code delegation authorizations here")), - out); - writeSignatureAndRecoveryId(transaction, out); - out.endList(); + out.startList(); + out.writeBigIntegerScalar(transaction.getChainId().orElseThrow()); + out.writeLongScalar(transaction.getNonce()); + out.writeUInt256Scalar(transaction.getMaxPriorityFeePerGas().orElseThrow()); + out.writeUInt256Scalar(transaction.getMaxFeePerGas().orElseThrow()); + out.writeLongScalar(transaction.getGasLimit()); + out.writeBytes(transaction.getTo().map(Bytes::copy).orElse(Bytes.EMPTY)); + out.writeUInt256Scalar(transaction.getValue()); + out.writeBytes(transaction.getPayload()); + writeAccessList(out, transaction.getAccessList()); + encodeCodeDelegationInner( + transaction + .getCodeDelegationList() + .orElseThrow( + () -> + new IllegalStateException( + "Developer error: the transaction should be guaranteed to have a code delegation authorizations here")), + out); + writeSignatureAndRecoveryId(transaction, out); + out.endList(); } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java index d4438e0ede9..bc8e41da820 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/EIP1559TransactionEncoder.java @@ -25,17 +25,17 @@ public class EIP1559TransactionEncoder { public static void encode(final Transaction transaction, final RLPOutput out) { - out.startList(); - out.writeBigIntegerScalar(transaction.getChainId().orElseThrow()); - out.writeLongScalar(transaction.getNonce()); - out.writeUInt256Scalar(transaction.getMaxPriorityFeePerGas().orElseThrow()); - out.writeUInt256Scalar(transaction.getMaxFeePerGas().orElseThrow()); - out.writeLongScalar(transaction.getGasLimit()); - out.writeBytes(transaction.getTo().map(Bytes::copy).orElse(Bytes.EMPTY)); - out.writeUInt256Scalar(transaction.getValue()); - out.writeBytes(transaction.getPayload()); - writeAccessList(out, transaction.getAccessList()); - writeSignatureAndRecoveryId(transaction, out); - out.endList(); + out.startList(); + out.writeBigIntegerScalar(transaction.getChainId().orElseThrow()); + out.writeLongScalar(transaction.getNonce()); + out.writeUInt256Scalar(transaction.getMaxPriorityFeePerGas().orElseThrow()); + out.writeUInt256Scalar(transaction.getMaxFeePerGas().orElseThrow()); + out.writeLongScalar(transaction.getGasLimit()); + out.writeBytes(transaction.getTo().map(Bytes::copy).orElse(Bytes.EMPTY)); + out.writeUInt256Scalar(transaction.getValue()); + out.writeBytes(transaction.getPayload()); + writeAccessList(out, transaction.getAccessList()); + writeSignatureAndRecoveryId(transaction, out); + out.endList(); } } diff --git a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java index 1703a1c61c0..039c3871040 100644 --- a/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java +++ b/ethereum/core/src/main/java/org/hyperledger/besu/ethereum/core/encoding/FrontierTransactionEncoder.java @@ -23,14 +23,14 @@ public class FrontierTransactionEncoder { public static void encode(final Transaction transaction, final RLPOutput out) { - out.startList(); - out.writeLongScalar(transaction.getNonce()); - out.writeUInt256Scalar(transaction.getGasPrice().orElseThrow()); - out.writeLongScalar(transaction.getGasLimit()); - out.writeBytes(transaction.getTo().map(Bytes::copy).orElse(Bytes.EMPTY)); - out.writeUInt256Scalar(transaction.getValue()); - out.writeBytes(transaction.getPayload()); - writeSignatureAndV(transaction, out); - out.endList(); + out.startList(); + out.writeLongScalar(transaction.getNonce()); + out.writeUInt256Scalar(transaction.getGasPrice().orElseThrow()); + out.writeLongScalar(transaction.getGasLimit()); + out.writeBytes(transaction.getTo().map(Bytes::copy).orElse(Bytes.EMPTY)); + out.writeUInt256Scalar(transaction.getValue()); + out.writeBytes(transaction.getPayload()); + writeSignatureAndV(transaction, out); + out.endList(); } }