class EthSubmitWork implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    final Optional<EthHashSolverInputs> solver = miner.getWorkDefinition();
    if (solver.isPresent()) {
      final EthHashSolution solution =
          new EthHashSolution(
              Bytes.fromHexString(requestContext.getRequiredParameter(0, String.class)).getLong(0),
              requestContext.getRequiredParameter(2, Hash.class),
              Bytes.fromHexString(requestContext.getRequiredParameter(1, String.class))
                  .toArrayUnsafe());
      final boolean result = miner.submitWork(solution);
      return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), result);
    } else {
      LOG.trace("Mining is not operational, eth_submitWork request cannot be processed");
      return new JsonRpcErrorResponse(
          requestContext.getRequest().getId(), JsonRpcError.NO_MINING_WORK_FOUND);
    }
  }

  public  EthSubmitWork(final MiningCoordinator miner);

}