@ -64,7 +64,7 @@ defmodule Explorer.Staking.EpochCounter do
def handle_info({:chain_event, :blocks, :realtime, blocks}, state) do
new_block_number =
blocks
|> Enum.map(& &1[:number])
|> Enum.map(&Map.get(&1, :number, 0))
|> Enum.max(fn -> 0 end)
case :ets.lookup(@table_name, @epoch_end_key) do
@ -37,7 +37,7 @@ defmodule Explorer.Staking.EpochCounterTest do
event_type = :blocks
broadcast_type = :realtime
event_data = [%{number: 881}]
event_data = [%Explorer.Chain.Block{number: 881}]
set_mox(11, 960)
Publisher.broadcast([{event_type, event_data}], broadcast_type)