class IbftGetValidatorsByBlockNumber extends AbstractBlockParameterMethod implements JsonRpcMethod {

  @Override
  protected Object resultByBlockNumber(
      final JsonRpcRequestContext request, final long blockNumber) {
    final Optional<BlockHeader> blockHeader =
        getBlockchainQueries().getBlockHeaderByNumber(blockNumber);
    LOG.trace("Received RPC rpcName={} block={}", getName(), blockNumber);
    return blockHeader
        .map(
            header ->
                blockInterface.validatorsInBlock(header).stream()
                    .map(validator -> validator.toString())
                    .collect(Collectors.toList()))
        .orElse(null);
  }

  public  IbftGetValidatorsByBlockNumber(
      final BlockchainQueries blockchainQueries, final BlockInterface blockInterface);

}