fix error with access behavior

pull/1916/head
saneery 6 years ago
parent 0302febdd1
commit a3ea06cc4a
  1. 2
      apps/explorer/lib/explorer/staking/epoch_counter.ex
  2. 2
      apps/explorer/test/explorer/staking/epoch_counter_test.exs

@ -64,7 +64,7 @@ defmodule Explorer.Staking.EpochCounter do
def handle_info({:chain_event, :blocks, :realtime, blocks}, state) do def handle_info({:chain_event, :blocks, :realtime, blocks}, state) do
new_block_number = new_block_number =
blocks blocks
|> Enum.map(& &1[:number]) |> Enum.map(&Map.get(&1, :number, 0))
|> Enum.max(fn -> 0 end) |> Enum.max(fn -> 0 end)
case :ets.lookup(@table_name, @epoch_end_key) do case :ets.lookup(@table_name, @epoch_end_key) do

@ -37,7 +37,7 @@ defmodule Explorer.Staking.EpochCounterTest do
event_type = :blocks event_type = :blocks
broadcast_type = :realtime broadcast_type = :realtime
event_data = [%{number: 881}] event_data = [%Explorer.Chain.Block{number: 881}]
set_mox(11, 960) set_mox(11, 960)
Publisher.broadcast([{event_type, event_data}], broadcast_type) Publisher.broadcast([{event_type, event_data}], broadcast_type)

Loading…
Cancel
Save