Skip to content

Commit

Permalink
5098 branch 18 update more invalid params (hyperledger#7459)
Browse files Browse the repository at this point in the history
* 5098: Add RpcErrorTypes

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Modify InvalidJsonRpcParameters and InvalidJsonRpcRequestException, apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Modify InvalidJsonRpcParameters and InvalidJsonRpcRequestException, apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Add JsonRpcParameterException for later use

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update locations for RpcErrorType.INVALID_ACCOUNTS_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Address review comments, apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with changes from branch 1

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update code to use RpcErrorType.INVALID_ADDRESS_HASH_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update plugin-api gradle hash

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Add comment on INVALID_PARAMS_ERROR_CODE

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Apply spotless on latest changes

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update code to use RpcErrorType.INVALID_ADDRESS_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken unit test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken unit test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with usage of RpcErrorType.INVALID_AUTH_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with usage of RpcErrorType.INVALID_BLOB_COUNT

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with usage of RpcErrorType.INVALID_BLOB_GAS_USED_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with usage of RpcErrorType.INVALID_BLOCK_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with usage of RpcErrorType.INVALID_BLOCK_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with usage of RpcErrorType.INVALID_BLOCK_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update with usage of RpcErrorType.INVALID_BLOCK_COUNT_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken integration test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Add index to exception messages

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: apoply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update BaseJsonRpcProcessor to utilise RpcErrorType from InvalidJsonRpcParameters

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Include parameter index in INVALID_AUTH_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Include parameter index in INVALID_BLOCK_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Include parameter index in INVALID_BLOCK_COUNT_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken integration test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Rename INVALID_AUTH_PARAMS to INVALID_PROPOSAL_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update INVALID_BLOCK_HASH_PARAMS locations

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken unit test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_BLOCK_INDEX

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_BLOCK_NUMBER

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken tests

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_CALL_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_CONSOLIDATION_REQUEST_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_CREATE_PRIVACY_GROUP_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_DATA_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_DEPOSIT_REQUEST_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_ENGINE_EXCHANGE_TRANSITION_CONFIGURATION_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_ENGINE_FORKCHOICE_UPDATED_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_ENGINE_PAYLOAD_ATTRIBUTES_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_ENGINE_PAYLOAD_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_ENGINE_PREPARE_PAYLOAD_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_ENODE_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_EXCESS_BLOB_GAS_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_EXTRA_DATA_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update RpcErrorType.INVALID_FILTER_PARAMS

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Fix broken tests

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Update several RpcErrorTypes

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Apply spotless

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Hopefully fix broken integration test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

* 5098: Hopefully fix broken integration test

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>

---------

Signed-off-by: Matilda Clerke <matilda.clerke@consensys.net>
Signed-off-by: Matilda-Clerke <matilda.clerke@consensys.net>
Co-authored-by: Sally MacFarlane <macfarla.github@gmail.com>
  • Loading branch information
Matilda-Clerke and macfarla authored Aug 15, 2024
1 parent f5d6e72 commit cca2f75
Show file tree
Hide file tree
Showing 14 changed files with 75 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ public void missingHashesOrTransactionParameter() {

assertThat(thrown)
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessage("Missing required json rpc parameter at index 1");
.hasMessage("Invalid is transaction complete parameter (index 1)");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package org.hyperledger.besu.ethereum.api.jsonrpc.internal;

import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcRequestException;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;

import java.math.BigInteger;
import java.util.Objects;
Expand All @@ -34,7 +35,7 @@ public class JsonRpcRequestId {
@JsonCreator
public JsonRpcRequestId(final Object id) {
if (isRequestTypeInvalid(id)) {
throw new InvalidJsonRpcRequestException("Invalid id");
throw new InvalidJsonRpcRequestException("Invalid id", RpcErrorType.INVALID_ID_PARAMS);
}
this.id = id;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,32 @@ public String getName() {
@Override
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
try {
final String logLevel = requestContext.getRequiredParameter(0, String.class);
final String logLevel;
try {
logLevel = requestContext.getRequiredParameter(0, String.class);
} catch (Exception e) { // TODO:replace with JsonRpcParameter.JsonRpcParameterException
throw new InvalidJsonRpcParameters(
"Invalid log level parameter (index 0)", RpcErrorType.INVALID_LOG_LEVEL_PARAMS, e);
}
if (!VALID_PARAMS.contains(logLevel)) {
return new JsonRpcErrorResponse(
requestContext.getRequest().getId(), RpcErrorType.INVALID_PARAMS);
requestContext.getRequest().getId(), RpcErrorType.INVALID_LOG_LEVEL_PARAMS);
}
final Optional<String[]> optionalLogFilters;
try {
optionalLogFilters = requestContext.getOptionalParameter(1, String[].class);
} catch (Exception e) { // TODO:replace with JsonRpcParameter.JsonRpcParameterException
throw new InvalidJsonRpcParameters(
"Invalid log filter parameters (index 1)", RpcErrorType.INVALID_LOG_FILTER_PARAMS, e);
}
final Optional<String[]> optionalLogFilters =
requestContext.getOptionalParameter(1, String[].class);
optionalLogFilters.ifPresentOrElse(
logFilters ->
Arrays.stream(logFilters).forEach(logFilter -> setLogLevel(logFilter, logLevel)),
() -> setLogLevel("", logLevel));
return new JsonRpcSuccessResponse(requestContext.getRequest().getId());
} catch (InvalidJsonRpcParameters invalidJsonRpcParameters) {
return new JsonRpcErrorResponse(
requestContext.getRequest().getId(), RpcErrorType.INVALID_PARAMS);
requestContext.getRequest().getId(), invalidJsonRpcParameters.getRpcErrorType());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,13 @@ public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
throw new InvalidJsonRpcParameters(
"Invalid account address parameter (index 2)", RpcErrorType.INVALID_ADDRESS_PARAMS, e);
}
final Hash startKey =
Hash.fromHexStringLenient(requestContext.getRequiredParameter(3, String.class));
final Hash startKey;
try {
startKey = Hash.fromHexStringLenient(requestContext.getRequiredParameter(3, String.class));
} catch (Exception e) { // TODO:replace with JsonRpcParameter.JsonRpcParameterException
throw new InvalidJsonRpcParameters(
"Invalid data start hash parameter (index 3)", RpcErrorType.INVALID_DATA_HASH_PARAMS, e);
}
final int limit = requestContext.getRequiredParameter(4, Integer.class);

final Optional<Hash> blockHashOptional = hashFromParameter(blockParameterOrBlockHash);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,13 @@ private BlockResult transactionHash(final Hash hash) {
}

private boolean isCompleteTransactions(final JsonRpcRequestContext requestContext) {
return requestContext.getRequiredParameter(1, Boolean.class);
try {
return requestContext.getRequiredParameter(1, Boolean.class);
} catch (Exception e) { // TODO:replace with JsonRpcParameter.JsonRpcParameterException
throw new InvalidJsonRpcParameters(
"Invalid is complete transaction parameter (index 1)",
RpcErrorType.INVALID_IS_TRANSACTION_COMPLETE_PARAMS,
e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@ private BlockResult transactionHash(final long blockNumber) {
}

private boolean isCompleteTransactions(final JsonRpcRequestContext request) {
return request.getRequiredParameter(1, Boolean.class);
try {
return request.getRequiredParameter(1, Boolean.class);
} catch (Exception e) { // TODO:replace with JsonRpcParameter.JsonRpcParameterException
throw new InvalidJsonRpcParameters(
"Invalid is transaction complete parameter (index 1)",
RpcErrorType.INVALID_IS_TRANSACTION_COMPLETE_PARAMS,
e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@

import org.hyperledger.besu.ethereum.api.jsonrpc.RpcMethod;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequestContext;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;

import org.apache.tuweni.bytes.Bytes;
Expand All @@ -37,7 +39,13 @@ public String getName() {

@Override
public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
final String hashRate = requestContext.getRequiredParameter(0, String.class);
final String hashRate;
try {
hashRate = requestContext.getRequiredParameter(0, String.class);
} catch (Exception e) {
throw new InvalidJsonRpcParameters(
"Invalid hash rate parameter (index 0)", RpcErrorType.INVALID_HASH_RATE_PARAMS, e);
}
final String id = requestContext.getRequiredParameter(1, String.class);
return new JsonRpcSuccessResponse(
requestContext.getRequest().getId(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ public static JsonCallParameter validateAndGetCallParams(final JsonRpcRequestCon
&& (callParams.getMaxFeePerGas().isPresent()
|| callParams.getMaxPriorityFeePerGas().isPresent())) {
throw new InvalidJsonRpcParameters(
"gasPrice cannot be used with maxFeePerGas or maxPriorityFeePerGas");
"gasPrice cannot be used with maxFeePerGas or maxPriorityFeePerGas",
RpcErrorType.INVALID_GAS_PRICE_PARAMS);
}
return callParams;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public enum RpcErrorType implements RpcMethodError {
INVALID_CREATE_PRIVACY_GROUP_PARAMS(
INVALID_PARAMS_ERROR_CODE, "Invalid create privacy group params"),
INVALID_DATA_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid data params"),
INVALID_DATA_HASH_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid data hash params"),
INVALID_DEPOSIT_REQUEST_PARAMS(INVALID_PARAMS_ERROR_CODE, "Invalid deposit request"),
INVALID_ENGINE_EXCHANGE_TRANSITION_CONFIGURATION_PARAMS(
INVALID_PARAMS_ERROR_CODE, "Invalid engine exchange transition configuration params"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,7 @@ public void getBlockByHashWithMissingBooleanParameter() throws Exception {
assertThat(resp.code()).isEqualTo(200);
// Check general format of result
final JsonObject json = new JsonObject(resp.body().string());
final RpcErrorType expectedError = RpcErrorType.INVALID_PARAMS;
final RpcErrorType expectedError = RpcErrorType.INVALID_IS_TRANSACTION_COMPLETE_PARAMS;
testHelper.assertValidJsonRpcError(
json, id, expectedError.getCode(), expectedError.getMessage());
}
Expand Down Expand Up @@ -854,7 +854,7 @@ public void getBlockByHashWithInvalidBooleanParameter() throws Exception {
assertThat(resp.code()).isEqualTo(200);
// Check general format of result
final JsonObject json = new JsonObject(resp.body().string());
final RpcErrorType expectedError = RpcErrorType.INVALID_PARAMS;
final RpcErrorType expectedError = RpcErrorType.INVALID_IS_TRANSACTION_COMPLETE_PARAMS;
testHelper.assertValidJsonRpcError(
json, id, expectedError.getCode(), expectedError.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ public void requestHasNullArrayParameter() {
new JsonRpcRequestContext(
new JsonRpcRequest("2.0", "admin_changeLogLevel", new Object[] {null}));
final JsonRpcResponse expectedResponse =
new JsonRpcErrorResponse(request.getRequest().getId(), RpcErrorType.INVALID_PARAMS);
new JsonRpcErrorResponse(
request.getRequest().getId(), RpcErrorType.INVALID_LOG_LEVEL_PARAMS);

final JsonRpcResponse actualResponse = adminChangeLogLevel.response(request);
assertThat(actualResponse).usingRecursiveComparison().isEqualTo(expectedResponse);
Expand All @@ -129,7 +130,8 @@ public void requestHasInvalidStringLogLevelParameter() {
new JsonRpcRequestContext(
new JsonRpcRequest("2.0", "admin_changeLogLevel", new String[] {"INVALID"}));
final JsonRpcResponse expectedResponse =
new JsonRpcErrorResponse(request.getRequest().getId(), RpcErrorType.INVALID_PARAMS);
new JsonRpcErrorResponse(
request.getRequest().getId(), RpcErrorType.INVALID_LOG_LEVEL_PARAMS);

final JsonRpcResponse actualResponse = adminChangeLogLevel.response(request);
assertThat(actualResponse).usingRecursiveComparison().isEqualTo(expectedResponse);
Expand All @@ -141,7 +143,8 @@ public void requestHasInvalidLogFilterParameter() {
new JsonRpcRequestContext(
new JsonRpcRequest("2.0", "admin_changeLogLevel", new Object[] {"DEBUG", "INVALID"}));
final JsonRpcResponse expectedResponse =
new JsonRpcErrorResponse(request.getRequest().getId(), RpcErrorType.INVALID_PARAMS);
new JsonRpcErrorResponse(
request.getRequest().getId(), RpcErrorType.INVALID_LOG_FILTER_PARAMS);

final JsonRpcResponse actualResponse = adminChangeLogLevel.response(request);
assertThat(actualResponse).usingRecursiveComparison().isEqualTo(expectedResponse);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public void exceptionWhenNoHashSupplied() {
public void exceptionWhenNoBoolSupplied() {
assertThatThrownBy(() -> method.response(requestWithParams(ZERO_HASH)))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessage("Missing required json rpc parameter at index 1");
.hasMessage("Invalid is complete transaction parameter (index 1)");
verifyNoMoreInteractions(blockchainQueries);
}

Expand All @@ -85,8 +85,7 @@ public void exceptionWhenHashParamInvalid() {
public void exceptionWhenBoolParamInvalid() {
assertThatThrownBy(() -> method.response(requestWithParams(ZERO_HASH, "maybe")))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessage(
"Invalid json rpc parameter at index 1. Supplied value was: 'maybe' of type: 'java.lang.String' - expected type: 'java.lang.Boolean'");
.hasMessage("Invalid is complete transaction parameter (index 1)");
verifyNoMoreInteractions(blockchainQueries);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void exceptionWhenNoNumberSupplied() {
public void exceptionWhenNoBoolSupplied() {
assertThatThrownBy(() -> method.response(requestWithParams("0")))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessage("Missing required json rpc parameter at index 1");
.hasMessage("Invalid is transaction complete parameter (index 1)");
verifyNoMoreInteractions(blockchainQueries);
}

Expand All @@ -137,8 +137,7 @@ public void exceptionWhenNumberParamInvalid() {
public void exceptionWhenBoolParamInvalid() {
assertThatThrownBy(() -> method.response(requestWithParams("0", "maybe")))
.isInstanceOf(InvalidJsonRpcParameters.class)
.hasMessage(
"Invalid json rpc parameter at index 1. Supplied value was: 'maybe' of type: 'java.lang.String' - expected type: 'java.lang.Boolean'");
.hasMessage("Invalid is transaction complete parameter (index 1)");
verifyNoMoreInteractions(blockchainQueries);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
package org.hyperledger.besu.ethereum.stratum;

import org.hyperledger.besu.ethereum.api.jsonrpc.internal.JsonRpcRequest;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.exception.InvalidJsonRpcParameters;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.JsonRpcSuccessResponse;
import org.hyperledger.besu.ethereum.api.jsonrpc.internal.response.RpcErrorType;
import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator;
import org.hyperledger.besu.ethereum.mainnet.PoWSolution;
import org.hyperledger.besu.ethereum.mainnet.PoWSolverInputs;
Expand Down Expand Up @@ -78,7 +80,13 @@ default void handleHashrateSubmit(
final StratumConnection conn,
final JsonRpcRequest message,
final Consumer<String> sender) {
final String hashRate = message.getRequiredParameter(0, String.class);
final String hashRate;
try {
hashRate = message.getRequiredParameter(0, String.class);
} catch (Exception e) { // TODO:replace with JsonRpcParameter.JsonRpcParameterException
throw new InvalidJsonRpcParameters(
"Invalid hash rate parameter (index 0)", RpcErrorType.INVALID_HASH_RATE_PARAMS, e);
}
final String id = message.getRequiredParameter(1, String.class);
String response;
try {
Expand Down

0 comments on commit cca2f75

Please sign in to comment.