From 40e6fd76ca3c725b2da86899d48c605ee91d843e Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 5 Aug 2019 11:25:00 +0300 Subject: [PATCH] fix PGRange to Block.Range conversion --- apps/explorer/lib/explorer/chain/block/range.ex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/explorer/lib/explorer/chain/block/range.ex b/apps/explorer/lib/explorer/chain/block/range.ex index 26bf902142..c60cd2039d 100644 --- a/apps/explorer/lib/explorer/chain/block/range.ex +++ b/apps/explorer/lib/explorer/chain/block/range.ex @@ -136,10 +136,12 @@ defmodule Explorer.Chain.Block.Range do def load(_), do: :error + defp parse_upper(%PGRange{upper: :unbound}), do: :infinity defp parse_upper(%PGRange{upper: nil}), do: :infinity defp parse_upper(%PGRange{upper: upper, upper_inclusive: true}), do: upper defp parse_upper(%PGRange{upper: upper, upper_inclusive: false}), do: upper - 1 + defp parse_upper(%PGRange{lower: :unbound}), do: :negative_infinity defp parse_lower(%PGRange{lower: nil}), do: :negative_infinity defp parse_lower(%PGRange{lower: lower, lower_inclusive: true}), do: lower defp parse_lower(%PGRange{lower: lower, lower_inclusive: false}), do: lower + 1