diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/JsonRpcMethodsFactory.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/JsonRpcMethodsFactory.java index ce2855d216..0f5bae48d4 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/JsonRpcMethodsFactory.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/JsonRpcMethodsFactory.java @@ -338,7 +338,8 @@ blockchainQueries, new TransactionTracer(blockReplay), parameter), addMethods( enabledMethods, new PrivCreatePrivacyGroup(new Enclave(privacyParameters.getEnclaveUri()), parameter), - new PrivDeletePrivacyGroup(new Enclave(privacyParameters.getEnclaveUri()), parameter), + new PrivDeletePrivacyGroup( + new Enclave(privacyParameters.getEnclaveUri()), privacyParameters, parameter), new PrivFindPrivacyGroup(new Enclave(privacyParameters.getEnclaveUri()), parameter), new PrivGetPrivacyPrecompileAddress(privacyParameters), new PrivGetTransactionCount(parameter, privateTransactionHandler), diff --git a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivDeletePrivacyGroup.java b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivDeletePrivacyGroup.java index 01961e13e9..bea8d43824 100644 --- a/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivDeletePrivacyGroup.java +++ b/ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/privacy/priv/PrivDeletePrivacyGroup.java @@ -16,6 +16,7 @@ import tech.pegasys.pantheon.enclave.Enclave; import tech.pegasys.pantheon.enclave.types.DeletePrivacyGroupRequest; +import tech.pegasys.pantheon.ethereum.core.PrivacyParameters; import tech.pegasys.pantheon.ethereum.jsonrpc.RpcMethod; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.JsonRpcRequest; import tech.pegasys.pantheon.ethereum.jsonrpc.internal.methods.JsonRpcMethod; @@ -30,10 +31,15 @@ public class PrivDeletePrivacyGroup implements JsonRpcMethod { private static final Logger LOG = getLogger(); private final Enclave enclave; + private PrivacyParameters privacyParameters; private final JsonRpcParameter parameters; - public PrivDeletePrivacyGroup(final Enclave enclave, final JsonRpcParameter parameters) { + public PrivDeletePrivacyGroup( + final Enclave enclave, + final PrivacyParameters privacyParameters, + final JsonRpcParameter parameters) { this.enclave = enclave; + this.privacyParameters = privacyParameters; this.parameters = parameters; } @@ -46,13 +52,15 @@ public String getName() { public JsonRpcResponse response(final JsonRpcRequest request) { 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); + final String privacyGroupId = parameters.required(request.getParams(), 0, String.class); - LOG.trace("Deleting a privacy group with privacyGroupId {} and from {}", privacyGroupId, from); + LOG.trace( + "Deleting a privacy group with privacyGroupId {} and from {}", + privacyGroupId, + privacyParameters.getEnclavePublicKey()); DeletePrivacyGroupRequest deletePrivacyGroupRequest = - new DeletePrivacyGroupRequest(privacyGroupId, from); + new DeletePrivacyGroupRequest(privacyGroupId, privacyParameters.getEnclavePublicKey()); String response; try { response = enclave.deletePrivacyGroup(deletePrivacyGroupRequest);