pull/1516/head
Ayrat Badykov 6 years ago
parent e8c205ae27
commit 9d21d4687f
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 1
      apps/indexer/lib/indexer/address/coin_balances.ex
  2. 8
      apps/indexer/test/indexer/address/coin_balances_test.exs

@ -39,6 +39,7 @@ defmodule Indexer.Address.CoinBalances do
nil
end)
|> Enum.reject(fn val -> is_nil(val) end)
|> MapSet.new()
end
defp reducer({:transactions_params, transactions_params}, initial) when is_list(transactions_params) do

@ -113,8 +113,8 @@ defmodule Indexer.Address.CoinBalancesTest do
params_set = CoinBalances.params_set(%{logs_params: [log_params]})
assert Enum.count(params_set) == 1
assert %{address_hash: address_hash, block_number: block_number} == List.first(params_set)
assert MapSet.size(params_set) == 1
assert MapSet.new([%{address_hash: address_hash, block_number: block_number}]) == params_set
end
test "with log skips pending transactions" do
@ -139,8 +139,8 @@ defmodule Indexer.Address.CoinBalancesTest do
params_set = CoinBalances.params_set(%{logs_params: [log_params1, log_params2]})
assert Enum.count(params_set) == 1
assert %{address_hash: address_hash, block_number: block_number} == List.first(params_set)
assert MapSet.size(params_set) == 1
assert MapSet.new([%{address_hash: address_hash, block_number: block_number}]) == params_set
end
test "with transaction without to_address_hash extracts from_address_hash" do

Loading…
Cancel
Save