diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/ExpectValidPrivateTransactionReceipt.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/ExpectValidPrivateTransactionReceipt.java index cc8fb48ec16..fdf307091ef 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/ExpectValidPrivateTransactionReceipt.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/ExpectValidPrivateTransactionReceipt.java @@ -19,7 +19,7 @@ import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.PrivacyTransactions; -import org.web3j.protocol.eea.response.PrivateTransactionReceipt; +import org.web3j.protocol.pantheon.response.privacy.PrivateTransactionReceipt; public class ExpectValidPrivateTransactionReceipt implements PrivateCondition { private final PrivacyTransactions transactions; diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/EeaGetTransactionReceiptTransaction.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivGetTransactionReceiptTransaction.java similarity index 87% rename from acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/EeaGetTransactionReceiptTransaction.java rename to acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivGetTransactionReceiptTransaction.java index 2b84ad6cf64..bc17abbe183 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/EeaGetTransactionReceiptTransaction.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivGetTransactionReceiptTransaction.java @@ -21,16 +21,17 @@ import java.io.IOException; -import org.web3j.protocol.eea.response.PrivateTransactionReceipt; import org.web3j.protocol.exceptions.TransactionException; import org.web3j.protocol.pantheon.Pantheon; +import org.web3j.protocol.pantheon.response.privacy.PrivateTransactionReceipt; import org.web3j.tx.response.PollingPrivateTransactionReceiptProcessor; -public class EeaGetTransactionReceiptTransaction implements Transaction { +public class PrivGetTransactionReceiptTransaction + implements Transaction { private final String transactionHash; - public EeaGetTransactionReceiptTransaction(final String transactionHash) { + public PrivGetTransactionReceiptTransaction(final String transactionHash) { this.transactionHash = transactionHash; } diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivateTransactionVerifier.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivateTransactionVerifier.java index 1365ca28979..dbcef1abae8 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivateTransactionVerifier.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/condition/PrivateTransactionVerifier.java @@ -16,8 +16,8 @@ import org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction.PrivacyTransactions; -import org.web3j.protocol.eea.response.PrivateTransactionReceipt; import org.web3j.protocol.pantheon.response.privacy.PrivacyGroup; +import org.web3j.protocol.pantheon.response.privacy.PrivateTransactionReceipt; public class PrivateTransactionVerifier { diff --git a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/PrivacyTransactions.java b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/PrivacyTransactions.java index bcac26d4253..7c742b91ae3 100644 --- a/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/PrivacyTransactions.java +++ b/acceptance-tests/dsl/src/main/java/org/hyperledger/besu/tests/acceptance/dsl/privacy/transaction/PrivacyTransactions.java @@ -15,15 +15,15 @@ package org.hyperledger.besu.tests.acceptance.dsl.privacy.transaction; import org.hyperledger.besu.tests.acceptance.dsl.privacy.PrivacyNode; -import org.hyperledger.besu.tests.acceptance.dsl.privacy.condition.EeaGetTransactionReceiptTransaction; +import org.hyperledger.besu.tests.acceptance.dsl.privacy.condition.PrivGetTransactionReceiptTransaction; import java.util.List; public class PrivacyTransactions { - public EeaGetTransactionReceiptTransaction getPrivateTransactionReceipt( + public PrivGetTransactionReceiptTransaction getPrivateTransactionReceipt( final String transactionHash) { - return new EeaGetTransactionReceiptTransaction(transactionHash); + return new PrivGetTransactionReceiptTransaction(transactionHash); } public CreatePrivacyGroupTransaction createPrivacyGroup( diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java index 63938f8ccf0..d59d1f83f7e 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EnclaveErrorAcceptanceTest.java @@ -28,7 +28,7 @@ import org.apache.tuweni.crypto.sodium.Box; import org.junit.Before; import org.junit.Test; -import org.web3j.protocol.eea.response.PrivateTransactionReceipt; +import org.web3j.protocol.pantheon.response.privacy.PrivateTransactionReceipt; public class EnclaveErrorAcceptanceTest extends PrivacyAcceptanceTestBase { diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EthSignerAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EthSignerAcceptanceTest.java index 4d759fd310e..882ad095976 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EthSignerAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/EthSignerAcceptanceTest.java @@ -28,8 +28,8 @@ import org.junit.Before; import org.junit.Ignore; import org.junit.Test; -import org.web3j.protocol.eea.response.PrivateTransactionReceipt; import org.web3j.protocol.pantheon.response.privacy.PrivacyGroup; +import org.web3j.protocol.pantheon.response.privacy.PrivateTransactionReceipt; import org.web3j.utils.Base64String; public class EthSignerAcceptanceTest extends PrivacyAcceptanceTestBase { diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/Ibft2PrivacyClusterAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/Ibft2PrivacyClusterAcceptanceTest.java index b7042267e87..4f613afb5f6 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/Ibft2PrivacyClusterAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/Ibft2PrivacyClusterAcceptanceTest.java @@ -22,7 +22,7 @@ import org.junit.Before; import org.junit.Test; -import org.web3j.protocol.eea.response.PrivateTransactionReceipt; +import org.web3j.protocol.pantheon.response.privacy.PrivateTransactionReceipt; public class Ibft2PrivacyClusterAcceptanceTest extends PrivacyAcceptanceTestBase { diff --git a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/PrivacyClusterAcceptanceTest.java b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/PrivacyClusterAcceptanceTest.java index 07e773ce086..5f07136b089 100644 --- a/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/PrivacyClusterAcceptanceTest.java +++ b/acceptance-tests/tests/src/test/java/org/hyperledger/besu/tests/web3j/privacy/PrivacyClusterAcceptanceTest.java @@ -22,7 +22,7 @@ import org.junit.Before; import org.junit.Test; -import org.web3j.protocol.eea.response.PrivateTransactionReceipt; +import org.web3j.protocol.pantheon.response.privacy.PrivateTransactionReceipt; public class PrivacyClusterAcceptanceTest extends PrivacyAcceptanceTestBase { diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcMethodsFactory.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcMethodsFactory.java index da9454fdadc..bd3952fec29 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcMethodsFactory.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/JsonRpcMethodsFactory.java @@ -92,7 +92,6 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.methods.permissioning.PermRemoveNodesFromWhitelist; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.parameters.JsonRpcParameter; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.EeaGetTransactionCount; -import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.EeaGetTransactionReceipt; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.EeaPrivateNonceProvider; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea.EeaSendRawTransaction; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv.PrivCreatePrivacyGroup; @@ -101,6 +100,7 @@ import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv.PrivGetPrivacyPrecompileAddress; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv.PrivGetPrivateTransaction; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv.PrivGetTransactionCount; +import org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv.PrivGetTransactionReceipt; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockReplay; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.BlockTracer; import org.hyperledger.besu.ethereum.api.jsonrpc.internal.processor.TransactionTracer; @@ -365,7 +365,6 @@ blockchainQueries, new TransactionTracer(blockReplay), parameter), if (eea) { addMethods( enabledMethods, - new EeaGetTransactionReceipt(blockchainQueries, enclave, parameter, privacyParameters), new EeaSendRawTransaction(privateTransactionHandler, transactionPool, parameter), new EeaGetTransactionCount( parameter, new EeaPrivateNonceProvider(enclave, privateTransactionHandler))); @@ -373,6 +372,7 @@ blockchainQueries, new TransactionTracer(blockReplay), parameter), if (priv) { addMethods( enabledMethods, + new PrivGetTransactionReceipt(blockchainQueries, enclave, parameter, privacyParameters), new PrivCreatePrivacyGroup( new Enclave(privacyParameters.getEnclaveUri()), privacyParameters, parameter), new PrivDeletePrivacyGroup( diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java index c9a7b9b9d57..3d494f284ce 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/RpcMethod.java @@ -38,7 +38,7 @@ public enum RpcMethod { PRIV_GET_PRIVATE_TRANSACTION("priv_getPrivateTransaction"), PRIV_GET_TRANSACTION_COUNT("priv_getTransactionCount"), PRIV_GET_PRIVACY_PRECOMPILE_ADDRESS("priv_getPrivacyPrecompileAddress"), - EEA_GET_TRANSACTION_RECEIPT("eea_getTransactionReceipt"), + PRIV_GET_TRANSACTION_RECEIPT("priv_getTransactionReceipt"), PRIV_CREATE_PRIVACY_GROUP("priv_createPrivacyGroup"), PRIV_DELETE_PRIVACY_GROUP("priv_deletePrivacyGroup"), PRIV_FIND_PRIVACY_GROUP("priv_findPrivacyGroup"), diff --git a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaGetTransactionReceipt.java b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceipt.java similarity index 96% rename from ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaGetTransactionReceipt.java rename to ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceipt.java index 4286e3a1af8..a8486be0d42 100644 --- a/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaGetTransactionReceipt.java +++ b/ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceipt.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea; +package org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv; import static org.apache.logging.log4j.LogManager.getLogger; @@ -50,7 +50,7 @@ import org.apache.logging.log4j.Logger; -public class EeaGetTransactionReceipt implements JsonRpcMethod { +public class PrivGetTransactionReceipt implements JsonRpcMethod { private static final Logger LOG = getLogger(); @@ -59,7 +59,7 @@ public class EeaGetTransactionReceipt implements JsonRpcMethod { private final JsonRpcParameter parameters; private final PrivacyParameters privacyParameters; - public EeaGetTransactionReceipt( + public PrivGetTransactionReceipt( final BlockchainQueries blockchain, final Enclave enclave, final JsonRpcParameter parameters, @@ -72,12 +72,12 @@ public EeaGetTransactionReceipt( @Override public String getName() { - return RpcMethod.EEA_GET_TRANSACTION_RECEIPT.getMethodName(); + return RpcMethod.PRIV_GET_TRANSACTION_RECEIPT.getMethodName(); } @Override public JsonRpcResponse response(final JsonRpcRequest request) { - LOG.trace("Executing {}", RpcMethod.EEA_GET_TRANSACTION_RECEIPT.getMethodName()); + LOG.trace("Executing {}", RpcMethod.PRIV_GET_TRANSACTION_RECEIPT.getMethodName()); final Hash transactionHash = parameters.required(request.getParams(), 0, Hash.class); final Optional maybeLocation = blockchain.getBlockchain().getTransactionLocation(transactionHash); diff --git a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaGetTransactionReceiptTest.java b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceiptTest.java similarity index 87% rename from ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaGetTransactionReceiptTest.java rename to ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceiptTest.java index ef5d76515cc..7a4a7ba67ec 100644 --- a/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/eea/EeaGetTransactionReceiptTest.java +++ b/ethereum/api/src/test/java/org/hyperledger/besu/ethereum/api/jsonrpc/internal/privacy/methods/priv/PrivGetTransactionReceiptTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.eea; +package org.hyperledger.besu.ethereum.api.jsonrpc.internal.privacy.methods.priv; import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; @@ -59,7 +59,7 @@ import org.junit.Test; import org.junit.rules.TemporaryFolder; -public class EeaGetTransactionReceiptTest { +public class PrivGetTransactionReceiptTest { @Rule public final TemporaryFolder temp = new TemporaryFolder(); @@ -163,13 +163,13 @@ public void setUp() { @Test public void returnReceiptIfTransactionExists() { - final EeaGetTransactionReceipt eeaGetTransactionReceipt = - new EeaGetTransactionReceipt(blockchainQueries, enclave, parameters, privacyParameters); + final PrivGetTransactionReceipt privGetTransactionReceipt = + new PrivGetTransactionReceipt(blockchainQueries, enclave, parameters, privacyParameters); final Object[] params = new Object[] {transaction.hash()}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_getTransactionReceipt", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_getTransactionReceipt", params); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) eeaGetTransactionReceipt.response(request); + (JsonRpcSuccessResponse) privGetTransactionReceipt.response(request); final PrivateTransactionReceiptResult result = (PrivateTransactionReceiptResult) response.getResult(); @@ -181,14 +181,14 @@ public void enclavePayloadNotFoundResultsInSuccessButNullResponse() { when(failingEnclave.receive(any(ReceiveRequest.class))) .thenThrow(new EnclaveException("EnclavePayloadNotFound")); - final EeaGetTransactionReceipt eeaGetTransactionReceipt = - new EeaGetTransactionReceipt( + final PrivGetTransactionReceipt privGetTransactionReceipt = + new PrivGetTransactionReceipt( blockchainQueries, failingEnclave, parameters, privacyParameters); final Object[] params = new Object[] {transaction.hash()}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_getTransactionReceipt", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_getTransactionReceipt", params); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) eeaGetTransactionReceipt.response(request); + (JsonRpcSuccessResponse) privGetTransactionReceipt.response(request); final PrivateTransactionReceiptResult result = (PrivateTransactionReceiptResult) response.getResult(); @@ -199,13 +199,13 @@ public void enclavePayloadNotFoundResultsInSuccessButNullResponse() { public void markerTransactionNotAvailableResultsInNullResponse() { when(blockchain.getTransactionLocation(nullable(Hash.class))).thenReturn(Optional.empty()); - final EeaGetTransactionReceipt eeaGetTransactionReceipt = - new EeaGetTransactionReceipt(blockchainQueries, enclave, parameters, privacyParameters); + final PrivGetTransactionReceipt privGetTransactionReceipt = + new PrivGetTransactionReceipt(blockchainQueries, enclave, parameters, privacyParameters); final Object[] params = new Object[] {transaction.hash()}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_getTransactionReceipt", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_getTransactionReceipt", params); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) eeaGetTransactionReceipt.response(request); + (JsonRpcSuccessResponse) privGetTransactionReceipt.response(request); final PrivateTransactionReceiptResult result = (PrivateTransactionReceiptResult) response.getResult(); @@ -214,13 +214,13 @@ public void markerTransactionNotAvailableResultsInNullResponse() { @Test public void enclaveConnectionIssueThrowsRuntimeException() { - final EeaGetTransactionReceipt eeaGetTransactionReceipt = - new EeaGetTransactionReceipt( + final PrivGetTransactionReceipt privGetTransactionReceipt = + new PrivGetTransactionReceipt( blockchainQueries, failingEnclave, parameters, privacyParameters); final Object[] params = new Object[] {transaction.hash()}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_getTransactionReceipt", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_getTransactionReceipt", params); - final Throwable t = catchThrowable(() -> eeaGetTransactionReceipt.response(request)); + final Throwable t = catchThrowable(() -> privGetTransactionReceipt.response(request)); assertThat(t).isInstanceOf(RuntimeException.class); } } diff --git a/gradle/versions.gradle b/gradle/versions.gradle index 19398ec9b52..193403b2750 100644 --- a/gradle/versions.gradle +++ b/gradle/versions.gradle @@ -94,10 +94,10 @@ dependencyManagement { dependency 'org.springframework.security:spring-security-crypto:5.1.5.RELEASE' - dependency 'org.web3j:abi:4.5.0' - dependency 'org.web3j:core:4.5.0' - dependency 'org.web3j:crypto:4.5.0' - dependency 'org.web3j:pantheon:4.5.0' + dependency 'org.web3j:abi:4.5.1' + dependency 'org.web3j:core:4.5.1' + dependency 'org.web3j:crypto:4.5.1' + dependency 'org.web3j:pantheon:4.5.1' dependency 'org.xerial.snappy:snappy-java:1.1.7.3'