class EthEstimateGas implements JsonRpcMethod {

  @Override
  public JsonRpcResponse response(final JsonRpcRequestContext requestContext) {
    final JsonCallParameter callParams =
        requestContext.getRequiredParameter(0, JsonCallParameter.class);

    final BlockHeader blockHeader = blockHeader();
    if (blockHeader == null) {
      return errorResponse(requestContext, JsonRpcError.INTERNAL_ERROR);
    }

    final JsonCallParameter modifiedCallParams =
        overrideGasLimitAndPrice(callParams, blockHeader.getGasLimit());

    final EstimateGasOperationTracer operationTracer = new EstimateGasOperationTracer();

    return transactionSimulator
        .process(modifiedCallParams, operationTracer, blockHeader.getNumber())
        .map(gasEstimateResponse(requestContext, operationTracer))
        .orElse(errorResponse(requestContext, JsonRpcError.INTERNAL_ERROR));
  }

  public  EthEstimateGas(
      final BlockchainQueries blockchainQueries, final TransactionSimulator transactionSimulator);

}