diff --git a/CHANGELOG.md b/CHANGELOG.md index 9c961c0f96..1f79421a57 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -374,7 +374,7 @@ Documentation updates include: ### Technical Improvements -- eea_getTransactionCount fails if account has not interacted with private state [\#1369](https://github.com/PegaSysEng/pantheon/pull/1369) +- priv_getTransactionCount fails if account has not interacted with private state [\#1369](https://github.com/PegaSysEng/pantheon/pull/1369) - Updating Orion to 0.9.0 [\#1360](https://github.com/PegaSysEng/pantheon/pull/1360) - Allow use of large chain IDs [\#1357](https://github.com/PegaSysEng/pantheon/pull/1357) - Allow private contract invocations in multiple privacy groups [\#1340](https://github.com/PegaSysEng/pantheon/pull/1340) diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/configuration/PantheonFactoryConfigurationBuilder.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/configuration/PantheonFactoryConfigurationBuilder.java index 927ac7978f..3f44f2c905 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/configuration/PantheonFactoryConfigurationBuilder.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/node/configuration/PantheonFactoryConfigurationBuilder.java @@ -87,6 +87,7 @@ public class PantheonFactoryConfigurationBuilder { public PantheonFactoryConfigurationBuilder enablePrivateTransactions( final PrivacyParameters privacyParameters) { this.jsonRpcConfiguration.addRpcApi(RpcApis.EEA); + this.jsonRpcConfiguration.addRpcApi(RpcApis.PRIV); this.privacyParameters = privacyParameters; this.privacyParameters.setEnabled(true); return this; diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivacyNode.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivacyNode.java index f56af47ddf..bdcb47ab1b 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivacyNode.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivacyNode.java @@ -28,7 +28,7 @@ import tech.pegasys.pantheon.ethereum.permissioning.PermissioningConfiguration; import tech.pegasys.pantheon.metrics.prometheus.MetricsConfiguration; import tech.pegasys.pantheon.tests.acceptance.dsl.node.PantheonNode; import tech.pegasys.pantheon.tests.acceptance.dsl.node.configuration.genesis.GenesisConfigurationProvider; -import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaGetTransactionCountTransaction; +import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.priv.PrivGetTransactionCountTransaction; import tech.pegasys.pantheon.util.bytes.BytesValue; import tech.pegasys.pantheon.util.bytes.BytesValues; @@ -115,7 +115,7 @@ public class PrivacyNode extends PantheonNode { public long nextNonce(final BytesValue privacyGroupId) { return execute( - new EeaGetTransactionCountTransaction( + new PrivGetTransactionCountTransaction( getAddress().toString(), BytesValues.asBase64String(privacyGroupId))) .longValue(); } diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivateTransactions.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivateTransactions.java index 80e2d5e92d..d5a6728fd3 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivateTransactions.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/privacy/PrivateTransactions.java @@ -12,8 +12,8 @@ */ package tech.pegasys.pantheon.tests.acceptance.dsl.privacy; -import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaGetTransactionCountTransaction; import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea.EeaSendRawTransactionTransaction; +import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.priv.PrivGetTransactionCountTransaction; public class PrivateTransactions { @@ -29,8 +29,8 @@ public class PrivateTransactions { return new EeaSendRawTransactionTransaction(signedRawPrivateTransaction); } - public EeaGetTransactionCountTransaction getTransactionCount( + public PrivGetTransactionCountTransaction getTransactionCount( final String address, final String privacyGroupId) { - return new EeaGetTransactionCountTransaction(address, privacyGroupId); + return new PrivGetTransactionCountTransaction(address, privacyGroupId); } } diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaRequestFactory.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaRequestFactory.java index 657992b1d8..9334fc88c4 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaRequestFactory.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaRequestFactory.java @@ -100,10 +100,10 @@ public class EeaRequestFactory { PrivateTransactionReceiptResponse.class); } - Request eeaGetTransactionCount( + public Request privGetTransactionCount( final String accountAddress, final String privacyGroupId) { return new Request<>( - "eea_getTransactionCount", + "priv_getTransactionCount", Lists.newArrayList(accountAddress, privacyGroupId), web3jService, EthGetTransactionCount.class); diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaTransactions.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaTransactions.java index ce1f870b0f..2d26fa0f4d 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaTransactions.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaTransactions.java @@ -12,15 +12,17 @@ */ package tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea; +import tech.pegasys.pantheon.tests.acceptance.dsl.transaction.priv.PrivGetTransactionCountTransaction; + public class EeaTransactions { public EeaGetTransactionReceiptTransaction getTransactionReceipt(final String transactionHash) { return new EeaGetTransactionReceiptTransaction(transactionHash); } - public EeaGetTransactionCountTransaction getTransactionCount( + public PrivGetTransactionCountTransaction getTransactionCount( final String address, final String privacyGroupId) { - return new EeaGetTransactionCountTransaction(address, privacyGroupId); + return new PrivGetTransactionCountTransaction(address, privacyGroupId); } public EeaGetTransactionReceiptTransaction getPrivateTransactionReceipt( diff --git a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaGetTransactionCountTransaction.java b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/priv/PrivGetTransactionCountTransaction.java similarity index 83% rename from acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaGetTransactionCountTransaction.java rename to acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/priv/PrivGetTransactionCountTransaction.java index 7160a1b7a2..64d406d9f0 100644 --- a/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/eea/EeaGetTransactionCountTransaction.java +++ b/acceptance-tests/src/test/java/tech/pegasys/pantheon/tests/acceptance/dsl/transaction/priv/PrivGetTransactionCountTransaction.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.tests.acceptance.dsl.transaction.eea; +package tech.pegasys.pantheon.tests.acceptance.dsl.transaction.priv; import static org.assertj.core.api.Assertions.assertThat; @@ -22,12 +22,12 @@ import java.math.BigInteger; import org.web3j.protocol.core.methods.response.EthGetTransactionCount; -public class EeaGetTransactionCountTransaction implements Transaction { +public class PrivGetTransactionCountTransaction implements Transaction { private final String accountAddress; private String privacyGroupId; - public EeaGetTransactionCountTransaction( + public PrivGetTransactionCountTransaction( final String accountAddress, final String privacyGroupId) { this.accountAddress = accountAddress; this.privacyGroupId = privacyGroupId; @@ -37,7 +37,7 @@ public class EeaGetTransactionCountTransaction implements Transaction DEFAULT_JSON_RPC_APIS = Arrays.asList(ETH, NET, WEB3); @@ -47,6 +48,8 @@ public class RpcApis { return Optional.of(ADMIN); } else if (name.equals(EEA.getCliValue())) { return Optional.of(EEA); + } else if (name.equals(PRIV.getCliValue())) { + return Optional.of(PRIV); } else if (name.equals(TX_POOL.getCliValue())) { return Optional.of(TX_POOL); } else { diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/RpcMethod.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/RpcMethod.java index bd6bc2a664..0a7303760d 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/RpcMethod.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/RpcMethod.java @@ -33,13 +33,13 @@ public enum RpcMethod { DEBUG_TRACE_BLOCK_BY_HASH("debug_traceBlockByHash"), DEBUG_TRACE_BLOCK_BY_NUMBER("debug_traceBlockByNumber"), DEBUG_TRACE_TRANSACTION("debug_traceTransaction"), - EEA_GET_PRIVATE_TRANSACTION("eea_getPrivateTransaction"), - EEA_GET_TRANSACTION_COUNT("eea_getTransactionCount"), - EEA_GET_PRIVACY_PRECOMPILE_ADDRESS("eea_getPrivacyPrecompileAddress"), + 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"), - EEA_CREATE_PRIVACY_GROUP("eea_createPrivacyGroup"), - EEA_DELETE_PRIVACY_GROUP("eea_deletePrivacyGroup"), - EEA_FIND_PRIVACY_GROUP("eea_findPrivacyGroup"), + PRIV_CREATE_PRIVACY_GROUP("priv_createPrivacyGroup"), + PRIV_DELETE_PRIVACY_GROUP("priv_deletePrivacyGroup"), + PRIV_FIND_PRIVACY_GROUP("priv_findPrivacyGroup"), EEA_SEND_RAW_TRANSACTION("eea_sendRawTransaction"), ETH_ACCOUNTS("eth_accounts"), ETH_BLOCK_NUMBER("eth_blockNumber"), diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionReceipt.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaGetTransactionReceipt.java similarity index 99% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionReceipt.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaGetTransactionReceipt.java index 2c3eda6b03..3df3a5b128 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionReceipt.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaGetTransactionReceipt.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.eea; import static org.apache.logging.log4j.LogManager.getLogger; diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaSendRawTransaction.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaSendRawTransaction.java similarity index 99% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaSendRawTransaction.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaSendRawTransaction.java index 2a2b875a99..da25cc2b6a 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaSendRawTransaction.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaSendRawTransaction.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.eea; import static tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcEnclaveErrorConverter.convertEnclaveInvalidReason; import static tech.pegasys.pantheon.ethereum.jsonrpc.JsonRpcErrorConverter.convertTransactionInvalidReason; diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaCreatePrivacyGroup.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivCreatePrivacyGroup.java similarity index 89% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaCreatePrivacyGroup.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivCreatePrivacyGroup.java index 5f272ffbe5..dbab2c8cae 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaCreatePrivacyGroup.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivCreatePrivacyGroup.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv; import static org.apache.logging.log4j.LogManager.getLogger; @@ -27,25 +27,25 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessRe import org.apache.logging.log4j.Logger; -public class EeaCreatePrivacyGroup implements JsonRpcMethod { +public class PrivCreatePrivacyGroup implements JsonRpcMethod { private static final Logger LOG = getLogger(); private final Enclave enclave; private final JsonRpcParameter parameters; - public EeaCreatePrivacyGroup(final Enclave enclave, final JsonRpcParameter parameters) { + public PrivCreatePrivacyGroup(final Enclave enclave, final JsonRpcParameter parameters) { this.enclave = enclave; this.parameters = parameters; } @Override public String getName() { - return RpcMethod.EEA_CREATE_PRIVACY_GROUP.getMethodName(); + return RpcMethod.PRIV_CREATE_PRIVACY_GROUP.getMethodName(); } @Override public JsonRpcResponse response(final JsonRpcRequest request) { - LOG.trace("Executing {}", RpcMethod.EEA_CREATE_PRIVACY_GROUP.getMethodName()); + LOG.trace("Executing {}", RpcMethod.PRIV_CREATE_PRIVACY_GROUP.getMethodName()); final String from = parameters.required(request.getParams(), 0, String.class); final String name = parameters.required(request.getParams(), 1, String.class); diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaDeletePrivacyGroup.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivDeletePrivacyGroup.java similarity index 88% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaDeletePrivacyGroup.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivDeletePrivacyGroup.java index 5763b5209d..01961e13e9 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaDeletePrivacyGroup.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivDeletePrivacyGroup.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv; import static org.apache.logging.log4j.LogManager.getLogger; @@ -26,25 +26,25 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessRe import org.apache.logging.log4j.Logger; -public class EeaDeletePrivacyGroup implements JsonRpcMethod { +public class PrivDeletePrivacyGroup implements JsonRpcMethod { private static final Logger LOG = getLogger(); private final Enclave enclave; private final JsonRpcParameter parameters; - public EeaDeletePrivacyGroup(final Enclave enclave, final JsonRpcParameter parameters) { + public PrivDeletePrivacyGroup(final Enclave enclave, final JsonRpcParameter parameters) { this.enclave = enclave; this.parameters = parameters; } @Override public String getName() { - return RpcMethod.EEA_DELETE_PRIVACY_GROUP.getMethodName(); + return RpcMethod.PRIV_DELETE_PRIVACY_GROUP.getMethodName(); } @Override public JsonRpcResponse response(final JsonRpcRequest request) { - LOG.trace("Executing {}", RpcMethod.EEA_DELETE_PRIVACY_GROUP.getMethodName()); + LOG.trace("Executing {}", RpcMethod.PRIV_DELETE_PRIVACY_GROUP.getMethodName()); final String privacyGroupId = parameters.required(request.getParams(), 1, String.class); final String from = parameters.required(request.getParams(), 0, String.class); diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaFindPrivacyGroup.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivFindPrivacyGroup.java similarity index 88% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaFindPrivacyGroup.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivFindPrivacyGroup.java index 271afa06f0..c79fcc3865 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaFindPrivacyGroup.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivFindPrivacyGroup.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv; import static org.apache.logging.log4j.LogManager.getLogger; @@ -29,25 +29,25 @@ import java.util.Arrays; import org.apache.logging.log4j.Logger; -public class EeaFindPrivacyGroup implements JsonRpcMethod { +public class PrivFindPrivacyGroup implements JsonRpcMethod { private static final Logger LOG = getLogger(); private final Enclave enclave; private final JsonRpcParameter parameters; - public EeaFindPrivacyGroup(final Enclave enclave, final JsonRpcParameter parameters) { + public PrivFindPrivacyGroup(final Enclave enclave, final JsonRpcParameter parameters) { this.enclave = enclave; this.parameters = parameters; } @Override public String getName() { - return RpcMethod.EEA_FIND_PRIVACY_GROUP.getMethodName(); + return RpcMethod.PRIV_FIND_PRIVACY_GROUP.getMethodName(); } @Override public JsonRpcResponse response(final JsonRpcRequest request) { - LOG.trace("Executing {}", RpcMethod.EEA_FIND_PRIVACY_GROUP.getMethodName()); + LOG.trace("Executing {}", RpcMethod.PRIV_FIND_PRIVACY_GROUP.getMethodName()); final String[] addresses = parameters.required(request.getParams(), 0, String[].class); diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivacyPrecompileAddress.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivacyPrecompileAddress.java similarity index 87% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivacyPrecompileAddress.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivacyPrecompileAddress.java index e798f6d817..4f86728ce7 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivacyPrecompileAddress.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivacyPrecompileAddress.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv; import tech.pegasys.pantheon.ethereum.core.PrivacyParameters; import tech.pegasys.pantheon.ethereum.jsonrpc.RpcMethod; @@ -21,19 +21,19 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcErrorResp import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcResponse; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessResponse; -public class EeaGetPrivacyPrecompileAddress implements JsonRpcMethod { +public class PrivGetPrivacyPrecompileAddress implements JsonRpcMethod { private final Integer privacyAddress; private final Boolean privacyEnabled; - public EeaGetPrivacyPrecompileAddress(final PrivacyParameters privacyParameters) { + public PrivGetPrivacyPrecompileAddress(final PrivacyParameters privacyParameters) { privacyAddress = privacyParameters.getPrivacyAddress(); privacyEnabled = privacyParameters.isEnabled(); } @Override public String getName() { - return RpcMethod.EEA_GET_PRIVACY_PRECOMPILE_ADDRESS.getMethodName(); + return RpcMethod.PRIV_GET_PRIVACY_PRECOMPILE_ADDRESS.getMethodName(); } @Override diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivateTransaction.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivateTransaction.java similarity index 93% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivateTransaction.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivateTransaction.java index 19122cc7cb..5d3f102629 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivateTransaction.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivateTransaction.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv; import static org.apache.logging.log4j.LogManager.getLogger; @@ -33,7 +33,7 @@ import tech.pegasys.pantheon.util.bytes.BytesValues; import org.apache.logging.log4j.Logger; -public class EeaGetPrivateTransaction implements JsonRpcMethod { +public class PrivGetPrivateTransaction implements JsonRpcMethod { private static final Logger LOG = getLogger(); @@ -41,7 +41,7 @@ public class EeaGetPrivateTransaction implements JsonRpcMethod { private final JsonRpcParameter parameters; private final PrivacyParameters privacyParameters; - public EeaGetPrivateTransaction( + public PrivGetPrivateTransaction( final Enclave enclave, final JsonRpcParameter parameters, final PrivacyParameters privacyParameters) { @@ -52,12 +52,12 @@ public class EeaGetPrivateTransaction implements JsonRpcMethod { @Override public String getName() { - return RpcMethod.EEA_GET_PRIVATE_TRANSACTION.getMethodName(); + return RpcMethod.PRIV_GET_PRIVATE_TRANSACTION.getMethodName(); } @Override public JsonRpcResponse response(final JsonRpcRequest request) { - LOG.trace("Executing {}", RpcMethod.EEA_GET_PRIVATE_TRANSACTION.getMethodName()); + LOG.trace("Executing {}", RpcMethod.PRIV_GET_PRIVATE_TRANSACTION.getMethodName()); final String enclaveKey = parameters.required(request.getParams(), 0, String.class); try { ReceiveResponse receiveResponse = diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionCount.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetTransactionCount.java similarity index 93% rename from ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionCount.java rename to ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetTransactionCount.java index 8d8342947e..b59386b427 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionCount.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetTransactionCount.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.jsonrpc.RpcMethod; @@ -24,12 +24,12 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessRe import tech.pegasys.pantheon.ethereum.jsonrpc.internal.results.Quantity; import tech.pegasys.pantheon.ethereum.privacy.PrivateTransactionHandler; -public class EeaGetTransactionCount implements JsonRpcMethod { +public class PrivGetTransactionCount implements JsonRpcMethod { private final JsonRpcParameter parameters; private final PrivateTransactionHandler privateTransactionHandler; - public EeaGetTransactionCount( + public PrivGetTransactionCount( final JsonRpcParameter parameters, final PrivateTransactionHandler privateTransactionHandler) { this.parameters = parameters; @@ -38,7 +38,7 @@ public class EeaGetTransactionCount implements JsonRpcMethod { @Override public String getName() { - return RpcMethod.EEA_GET_TRANSACTION_COUNT.getMethodName(); + return RpcMethod.PRIV_GET_TRANSACTION_COUNT.getMethodName(); } @Override diff --git a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaCreatePrivacyGroupTest.java b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaCreatePrivacyGroupTest.java similarity index 88% rename from ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaCreatePrivacyGroupTest.java rename to ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaCreatePrivacyGroupTest.java index ec28cd3417..2f39bfa48a 100644 --- a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaCreatePrivacyGroupTest.java +++ b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaCreatePrivacyGroupTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.eea; import static org.junit.Assert.assertEquals; import static org.mockito.ArgumentMatchers.any; @@ -20,6 +20,7 @@ import static org.mockito.Mockito.when; import tech.pegasys.pantheon.enclave.Enclave; import tech.pegasys.pantheon.enclave.types.PrivacyGroup; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.JsonRpcRequest; +import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv.PrivCreatePrivacyGroup; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.parameters.JsonRpcParameter; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessResponse; @@ -47,11 +48,11 @@ public class EeaCreatePrivacyGroupTest { new PrivacyGroup(privacyGroupId, PrivacyGroup.Type.PANTHEON, name, description, addresses); when(enclave.createPrivacyGroup(any())).thenReturn(privacyGroup); - final EeaCreatePrivacyGroup eeaCreatePrivacyGroup = - new EeaCreatePrivacyGroup(enclave, parameters); + final PrivCreatePrivacyGroup eeaCreatePrivacyGroup = + new PrivCreatePrivacyGroup(enclave, parameters); Object[] params = new Object[] {from, name, description, addresses}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_createPrivacyGroup", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_createPrivacyGroup", params); final JsonRpcSuccessResponse response = (JsonRpcSuccessResponse) eeaCreatePrivacyGroup.response(request); diff --git a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionReceiptTest.java b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaGetTransactionReceiptTest.java similarity index 99% rename from ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionReceiptTest.java rename to ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaGetTransactionReceiptTest.java index 9d2eefd457..1c3c2bb797 100644 --- a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionReceiptTest.java +++ b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaGetTransactionReceiptTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.eea; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; diff --git a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaSendRawTransactionTest.java b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaSendRawTransactionTest.java similarity index 99% rename from ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaSendRawTransactionTest.java rename to ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaSendRawTransactionTest.java index 21f6ab9242..cfab2b7e5b 100644 --- a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaSendRawTransactionTest.java +++ b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/EeaSendRawTransactionTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.eea; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; diff --git a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivateTransactionTest.java b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/PrivGetPrivateTransactionTest.java similarity index 88% rename from ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivateTransactionTest.java rename to ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/PrivGetPrivateTransactionTest.java index bd8e90aced..3832e82e03 100644 --- a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivateTransactionTest.java +++ b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/PrivGetPrivateTransactionTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.eea; import static java.nio.charset.StandardCharsets.UTF_8; import static org.assertj.core.api.Assertions.assertThat; @@ -26,6 +26,7 @@ import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.core.PrivacyParameters; import tech.pegasys.pantheon.ethereum.core.Wei; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.JsonRpcRequest; +import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv.PrivGetPrivateTransaction; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.parameters.JsonRpcParameter; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessResponse; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.results.privacy.PrivateTransactionGroupResult; @@ -45,7 +46,7 @@ import org.junit.Rule; import org.junit.Test; import org.junit.rules.TemporaryFolder; -public class EeaGetPrivateTransactionTest { +public class PrivGetPrivateTransactionTest { @Rule public final TemporaryFolder temp = new TemporaryFolder(); @@ -100,10 +101,10 @@ public class EeaGetPrivateTransactionTest { final PrivateTransactionLegacyResult privateTransactionLegacyResult = new PrivateTransactionLegacyResult(privateTransaction); - final EeaGetPrivateTransaction eeaGetPrivateTransaction = - new EeaGetPrivateTransaction(enclave, parameters, privacyParameters); + final PrivGetPrivateTransaction privGetPrivateTransaction = + new PrivGetPrivateTransaction(enclave, parameters, privacyParameters); final Object[] params = new Object[] {enclaveKey}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_getPrivateTransaction", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_getPrivateTransaction", params); final BytesValueRLPOutput bvrlp = new BytesValueRLPOutput(); privateTransaction.writeTo(bvrlp); @@ -113,7 +114,7 @@ public class EeaGetPrivateTransactionTest { Base64.getEncoder().encodeToString(bvrlp.encoded().extractArray()).getBytes(UTF_8), "")); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) eeaGetPrivateTransaction.response(request); + (JsonRpcSuccessResponse) privGetPrivateTransaction.response(request); final PrivateTransactionResult result = (PrivateTransactionResult) response.getResult(); assertThat(result).isEqualToComparingFieldByField(privateTransactionLegacyResult); @@ -128,10 +129,10 @@ public class EeaGetPrivateTransactionTest { final PrivateTransactionGroupResult privateTransactionGroupResult = new PrivateTransactionGroupResult(privateTransaction); - final EeaGetPrivateTransaction eeaGetPrivateTransaction = - new EeaGetPrivateTransaction(enclave, parameters, privacyParameters); + final PrivGetPrivateTransaction privGetPrivateTransaction = + new PrivGetPrivateTransaction(enclave, parameters, privacyParameters); final Object[] params = new Object[] {enclaveKey}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_getPrivateTransaction", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_getPrivateTransaction", params); final BytesValueRLPOutput bvrlp = new BytesValueRLPOutput(); privateTransaction.writeTo(bvrlp); @@ -141,7 +142,7 @@ public class EeaGetPrivateTransactionTest { Base64.getEncoder().encodeToString(bvrlp.encoded().extractArray()).getBytes(UTF_8), "")); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) eeaGetPrivateTransaction.response(request); + (JsonRpcSuccessResponse) privGetPrivateTransaction.response(request); final PrivateTransactionResult result = (PrivateTransactionResult) response.getResult(); assertThat(result).isEqualToComparingFieldByField(privateTransactionGroupResult); diff --git a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionCountTest.java b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/PrivGetTransactionCountTest.java similarity index 82% rename from ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionCountTest.java rename to ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/PrivGetTransactionCountTest.java index d00fa09f40..4e00dd1392 100644 --- a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetTransactionCountTest.java +++ b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/eea/PrivGetTransactionCountTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.eea; import static java.nio.charset.StandardCharsets.UTF_8; import static org.junit.Assert.assertEquals; @@ -19,6 +19,7 @@ import static org.mockito.Mockito.when; import tech.pegasys.pantheon.ethereum.core.Address; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.JsonRpcRequest; +import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv.PrivGetTransactionCount; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.parameters.JsonRpcParameter; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessResponse; import tech.pegasys.pantheon.ethereum.privacy.PrivateTransactionHandler; @@ -27,7 +28,7 @@ import tech.pegasys.pantheon.util.bytes.BytesValues; import org.junit.Test; -public class EeaGetTransactionCountTest { +public class PrivGetTransactionCountTest { private final JsonRpcParameter parameters = new JsonRpcParameter(); private final String privacyGroupId = @@ -43,14 +44,14 @@ public class EeaGetTransactionCountTest { mock(PrivateTransactionHandler.class); when(privateTransactionHandler.getSenderNonce(senderAddress, privacyGroupId)).thenReturn(NONCE); - final EeaGetTransactionCount eeaGetTransactionCount = - new EeaGetTransactionCount(parameters, privateTransactionHandler); + final PrivGetTransactionCount privGetTransactionCount = + new PrivGetTransactionCount(parameters, privateTransactionHandler); final Object[] params = new Object[] {senderAddress, privacyGroupId}; - final JsonRpcRequest request = new JsonRpcRequest("1", "eea_getTransactionCount", params); + final JsonRpcRequest request = new JsonRpcRequest("1", "priv_getTransactionCount", params); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) eeaGetTransactionCount.response(request); + (JsonRpcSuccessResponse) privGetTransactionCount.response(request); assertEquals(String.format("0x%X", NONCE), response.getResult()); } diff --git a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivacyPrecompileAddressTest.java b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivacyPrecompileAddressTest.java similarity index 76% rename from ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivacyPrecompileAddressTest.java rename to ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivacyPrecompileAddressTest.java index bbec69c5b5..4c98e113d8 100644 --- a/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/EeaGetPrivacyPrecompileAddressTest.java +++ b/ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivGetPrivacyPrecompileAddressTest.java @@ -10,7 +10,7 @@ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the * specific language governing permissions and limitations under the License. */ -package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy; +package tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.privacy.priv; import static org.junit.Assert.assertEquals; import static org.mockito.Mockito.mock; @@ -26,7 +26,7 @@ import tech.pegasys.pantheon.ethereum.jsonrpc.internal.response.JsonRpcSuccessRe import org.junit.Test; -public class EeaGetPrivacyPrecompileAddressTest { +public class PrivGetPrivacyPrecompileAddressTest { private final Integer privacyAddress = 127; private final PrivacyParameters privacyParameters = mock(PrivacyParameters.class); @@ -36,14 +36,14 @@ public class EeaGetPrivacyPrecompileAddressTest { when(privacyParameters.getPrivacyAddress()).thenReturn(privacyAddress); when(privacyParameters.isEnabled()).thenReturn(true); - final EeaGetPrivacyPrecompileAddress eeaGetPrivacyPrecompileAddress = - new EeaGetPrivacyPrecompileAddress(privacyParameters); + final PrivGetPrivacyPrecompileAddress privGetPrivacyPrecompileAddress = + new PrivGetPrivacyPrecompileAddress(privacyParameters); final JsonRpcRequest request = - new JsonRpcRequest("1", "eea_getPrivacyPrecompileAddress", new Object[0]); + new JsonRpcRequest("1", "priv_getPrivacyPrecompileAddress", new Object[0]); final JsonRpcSuccessResponse response = - (JsonRpcSuccessResponse) eeaGetPrivacyPrecompileAddress.response(request); + (JsonRpcSuccessResponse) privGetPrivacyPrecompileAddress.response(request); assertEquals(privacyAddress, response.getResult()); } @@ -53,13 +53,13 @@ public class EeaGetPrivacyPrecompileAddressTest { when(privacyParameters.getPrivacyAddress()).thenReturn(privacyAddress); when(privacyParameters.isEnabled()).thenReturn(false); - final EeaGetPrivacyPrecompileAddress eeaGetPrivacyPrecompileAddress = - new EeaGetPrivacyPrecompileAddress(privacyParameters); + final PrivGetPrivacyPrecompileAddress privGetPrivacyPrecompileAddress = + new PrivGetPrivacyPrecompileAddress(privacyParameters); final JsonRpcRequest request = - new JsonRpcRequest("1", "eea_getPrivacyPrecompileAddress", new Object[0]); + new JsonRpcRequest("1", "priv_getPrivacyPrecompileAddress", new Object[0]); - final JsonRpcResponse response = eeaGetPrivacyPrecompileAddress.response(request); + final JsonRpcResponse response = privGetPrivacyPrecompileAddress.response(request); assertEquals(JsonRpcResponseType.ERROR, response.getType()); assertEquals(JsonRpcError.PRIVACY_NOT_ENABLED, ((JsonRpcErrorResponse) response).getError());