Detailed msg when log filter not found (#428)

Lucas Saldanha 6 years ago committed by GitHub
parent 0e0aa98432
commit e62d68e877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/EthGetFilterLogs.java
  2. 1
      ethereum/jsonrpc/src/main/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/response/JsonRpcError.java
  3. 2
      ethereum/jsonrpc/src/test/java/tech/pegasys/pantheon/ethereum/jsonrpc/internal/methods/EthGetFilterLogsTest.java

@ -48,6 +48,6 @@ public class EthGetFilterLogs implements JsonRpcMethod {
return new JsonRpcSuccessResponse(request.getId(), new LogsResult(logs)); return new JsonRpcSuccessResponse(request.getId(), new LogsResult(logs));
} }
return new JsonRpcErrorResponse(request.getId(), JsonRpcError.FILTER_NOT_FOUND); return new JsonRpcErrorResponse(request.getId(), JsonRpcError.LOGS_FILTER_NOT_FOUND);
} }
} }

@ -28,6 +28,7 @@ public enum JsonRpcError {
// Filter & Subscription Errors // Filter & Subscription Errors
FILTER_NOT_FOUND(-32000, "Filter not found"), FILTER_NOT_FOUND(-32000, "Filter not found"),
LOGS_FILTER_NOT_FOUND(-32000, "Logs filter not found"),
SUBSCRIPTION_NOT_FOUND(-32000, "Subscription not found"), SUBSCRIPTION_NOT_FOUND(-32000, "Subscription not found"),
NO_MINING_WORK_FOUND(-32000, "No mining work available yet"), NO_MINING_WORK_FOUND(-32000, "No mining work available yet"),

@ -88,7 +88,7 @@ public class EthGetFilterLogsTest {
public void shouldReturnFilterNotFoundWhenFilterManagerReturnsNull() { public void shouldReturnFilterNotFoundWhenFilterManagerReturnsNull() {
final JsonRpcRequest request = requestWithFilterId("NOT FOUND"); final JsonRpcRequest request = requestWithFilterId("NOT FOUND");
final JsonRpcResponse expectedResponse = final JsonRpcResponse expectedResponse =
new JsonRpcErrorResponse(null, JsonRpcError.FILTER_NOT_FOUND); new JsonRpcErrorResponse(null, JsonRpcError.LOGS_FILTER_NOT_FOUND);
when(filterManager.logs(eq("NOT FOUND"))).thenReturn(null); when(filterManager.logs(eq("NOT FOUND"))).thenReturn(null);
final JsonRpcResponse response = method.response(request); final JsonRpcResponse response = method.response(request);

Loading…
Cancel
Save