class EthGetWork implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    final Optional<EthHashSolverInputs> solver = miner.getWorkDefinition();
    if (solver.isPresent()) {
      final EthHashSolverInputs rawResult = solver.get();
      final byte[] dagSeed = DirectAcyclicGraphSeed.dagSeed(rawResult.getBlockNumber());
      final String[] result = {
        "0x" + BaseEncoding.base16().lowerCase().encode(rawResult.getPrePowHash()),
        "0x" + BaseEncoding.base16().lowerCase().encode(dagSeed),
        rawResult.getTarget().toHexString(),
        Quantity.create(rawResult.getBlockNumber())
      };
      return new JsonRpcSuccessResponse(requestContext.getRequest().getId(), result);
    } else {
      LOG.trace("Mining is not operational, eth_getWork request cannot be processed");
      return new JsonRpcErrorResponse(
          requestContext.getRequest().getId(), JsonRpcError.NO_MINING_WORK_FOUND);
    }
  }

  public  EthGetWork(final MiningCoordinator miner);

}