|
|
@ -79,7 +79,7 @@ defmodule Indexer.Fetcher.CoinBalance do |
|
|
|
|
|
|
|
|
|
|
|
unique_filtered_entries = |
|
|
|
unique_filtered_entries = |
|
|
|
Enum.filter(unique_entries, fn {_hash, block_number} -> |
|
|
|
Enum.filter(unique_entries, fn {_hash, block_number} -> |
|
|
|
block_number > first_block_to_index() |
|
|
|
block_number >= first_block_to_index() |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|
|
|
|
unique_entry_count = Enum.count(unique_filtered_entries) |
|
|
|
unique_entry_count = Enum.count(unique_filtered_entries) |
|
|
@ -92,7 +92,7 @@ defmodule Indexer.Fetcher.CoinBalance do |
|
|
|
|> EthereumJSONRPC.fetch_balances(json_rpc_named_arguments) |
|
|
|
|> EthereumJSONRPC.fetch_balances(json_rpc_named_arguments) |
|
|
|
|> case do |
|
|
|
|> case do |
|
|
|
{:ok, fetched_balances} -> |
|
|
|
{:ok, fetched_balances} -> |
|
|
|
run_fetched_balances(fetched_balances, unique_entries) |
|
|
|
run_fetched_balances(fetched_balances, unique_filtered_entries) |
|
|
|
|
|
|
|
|
|
|
|
{:error, reason} -> |
|
|
|
{:error, reason} -> |
|
|
|
Logger.error( |
|
|
|
Logger.error( |
|
|
@ -102,7 +102,16 @@ defmodule Indexer.Fetcher.CoinBalance do |
|
|
|
error_count: unique_entry_count |
|
|
|
error_count: unique_entry_count |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
{:retry, unique_entries} |
|
|
|
{:retry, unique_filtered_entries} |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
defp first_block_to_index do |
|
|
|
|
|
|
|
string_value = Application.get_env(:indexer, :first_block) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case Integer.parse(string_value) do |
|
|
|
|
|
|
|
{integer, ""} -> integer |
|
|
|
|
|
|
|
_ -> 0 |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|