From dacab21f283668e71f362b196525c00bb146eb6d Mon Sep 17 00:00:00 2001 From: Luke Imhoff Date: Tue, 2 Oct 2018 09:56:02 -0500 Subject: [PATCH] Failing regression test for #838 --- apps/explorer/lib/explorer/chain.ex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index d34ff3c7b3..bbb54cd2d8 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -1164,6 +1164,14 @@ defmodule Explorer.Chain do iex> Explorer.Chain.missing_block_number_ranges(5..0) [4..3, 1..1] + If only non-consensus blocks exist for a number, the number still counts as missing. + + iex> insert(:block, number: 0) + iex> insert(:block, number: 1, consensus: false) + iex> insert(:block, number: 2) + iex> Explorer.Chain.missing_block_number_ranges(2..0) + [1..1] + """ @spec missing_block_number_ranges(Range.t()) :: [Range.t()] def missing_block_number_ranges(range)