class FullImportBlockStep implements Consumer<Block> {

  @Override
  public void accept(final Block block) {
    final long blockNumber = block.getHeader().getNumber();
    final String blockHash = block.getHash().toHexString();
    final String shortHash =
        String.format(
            "%s..%s",
            blockHash.substring(0, 6),
            blockHash.substring(blockHash.length() - 4, blockHash.length()));
    final BlockImporter importer =
        protocolSchedule.getByBlockNumber(blockNumber).getBlockImporter();
    if (!importer.importBlock(protocolContext, block, HeaderValidationMode.SKIP_DETACHED)) {
      throw new InvalidBlockException("Failed to import block", blockNumber, block.getHash());
    }
    int peerCount = -1; // ethContext is not available in tests
    if (ethContext != null && ethContext.getEthPeers().peerCount() >= 0) {
      peerCount = ethContext.getEthPeers().peerCount();
    }
    if (blockNumber % 200 == 0) {
      LOG.info("Import reached block {} ({}), Peers: {}", blockNumber, shortHash, peerCount);
    }
  }

  public  FullImportBlockStep(
      final ProtocolSchedule protocolSchedule,
      final ProtocolContext protocolContext,
      final EthContext ethContext);

}