Convert decimal to integer

(cherry picked from commit d6c492be9c)
pull/4761/head
Viktor Baranov 4 years ago
parent f9e6a9cb30
commit e75d3b7471
  1. 9
      apps/indexer/lib/indexer/fetcher/token_balance.ex

@ -145,8 +145,15 @@ defmodule Indexer.Fetcher.TokenBalance do
) do
retries_count = Map.get(token_balance, :retries_count, 0)
token_id_int =
case token_id do
%Decimal{} -> Decimal.to_integer(token_id)
id_int when is_integer(id_int) -> id_int
_ -> token_id
end
{address_hash.bytes, token_contract_address_hash.bytes, block_number, token_type,
token_id && Decimal.to_integer(token_id), retries_count}
token_id_int, retries_count}
end
defp format_params(

Loading…
Cancel
Save