From 27a673c0d602ed74d1e20658e1e133c21d847717 Mon Sep 17 00:00:00 2001 From: Danno Ferrin Date: Thu, 21 Sep 2023 17:39:35 -0600 Subject: [PATCH] remove unused parameters Signed-off-by: Danno Ferrin --- .../api/graphql/internal/pojoadapter/BlockAdapterBase.java | 4 ++-- .../api/graphql/internal/pojoadapter/CallResult.java | 2 +- .../graphql/internal/pojoadapter/TransactionAdapter.java | 2 +- .../besu/ethereum/api/graphql/BlockDataFetcherTest.java | 4 ++-- .../ethereum/api/graphql/TransactionDataFetcherTest.java | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/BlockAdapterBase.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/BlockAdapterBase.java index 4f976bc60a5..6d3884e61c0 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/BlockAdapterBase.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/BlockAdapterBase.java @@ -295,11 +295,11 @@ Optional> getWithdrawals(final DataFetchingEnvironment e .map(wl -> wl.stream().map(WithdrawalAdapter::new).toList())); } - public Optional getBlobGasUsed(final DataFetchingEnvironment environment) { + public Optional getBlobGasUsed() { return header.getBlobGasUsed(); } - public Optional getExcessBlobGas(final DataFetchingEnvironment environment) { + public Optional getExcessBlobGas() { return header.getExcessBlobGas().map(BlobGas::toLong); } } diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/CallResult.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/CallResult.java index cc44c36a1d2..78fa30d8748 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/CallResult.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/CallResult.java @@ -17,7 +17,7 @@ import org.apache.tuweni.bytes.Bytes; @SuppressWarnings("unused") // reflected by GraphQL -class CallResult { +public class CallResult { private final Long status; private final Long gasUsed; private final Bytes data; diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java index 6fd242205cd..c4aa2265c7c 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java @@ -259,7 +259,7 @@ public Optional getRawReceipt(final DataFetchingEnvironment environment) }); } - public List getBlobVersionedHashes(final DataFetchingEnvironment environment) { + public List getBlobVersionedHashes() { return transactionWithMetadata.getTransaction().getVersionedHashes().orElse(List.of()); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/BlockDataFetcherTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/BlockDataFetcherTest.java index 782ddb4c971..1ed6cc329b5 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/BlockDataFetcherTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/BlockDataFetcherTest.java @@ -110,7 +110,7 @@ void blobData() throws Exception { final Optional maybeBlock = fetcher.get(environment); assertThat(maybeBlock).isPresent(); - assertThat(maybeBlock.get().getBlobGasUsed(environment)).contains(blobGasUsed); - assertThat(maybeBlock.get().getExcessBlobGas(environment)).contains(excessBlobGas); + assertThat(maybeBlock.get().getBlobGasUsed()).contains(blobGasUsed); + assertThat(maybeBlock.get().getExcessBlobGas()).contains(excessBlobGas); } } diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java index ea487f9c31b..18b80f9bfd3 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/graphql/TransactionDataFetcherTest.java @@ -81,7 +81,7 @@ void emptyBlobs() throws Exception { var transactionData = fetcher.get(environment); assertThat(transactionData).isPresent(); - assertThat(transactionData.get().getBlobVersionedHashes(environment)).isEmpty(); + assertThat(transactionData.get().getBlobVersionedHashes()).isEmpty(); assertThat(transactionData.get().getBlobGasUsed(environment)).isEmpty(); assertThat(transactionData.get().getBlobGasPrice(environment)).isEmpty(); assertThat(transactionData.get().getMaxFeePerBlobGas()).isEmpty(); @@ -115,7 +115,7 @@ void hasZeroBlobs() throws Exception { var transactionData = fetcher.get(environment); assertThat(transactionData).isPresent(); - assertThat(transactionData.get().getBlobVersionedHashes(environment)).isEmpty(); + assertThat(transactionData.get().getBlobVersionedHashes()).isEmpty(); assertThat(transactionData.get().getBlobGasUsed(environment)).contains(0L); assertThat(transactionData.get().getBlobGasPrice(environment)).contains(Wei.ZERO); assertThat(transactionData.get().getMaxFeePerBlobGas()).contains(Wei.ZERO); @@ -149,7 +149,7 @@ void hasOneBlob() throws Exception { var transactionData = fetcher.get(environment); assertThat(transactionData).isPresent(); - assertThat(transactionData.get().getBlobVersionedHashes(environment)) + assertThat(transactionData.get().getBlobVersionedHashes()) .containsExactly(fakeVersionedHash); assertThat(transactionData.get().getBlobGasUsed(environment)).contains(blobGasUsed); assertThat(transactionData.get().getBlobGasPrice(environment)).contains(blobGasPrice);