fix: Use token_type from tt instead of token (#10555)

production-fuse
Qwerty5Uiop 4 months ago committed by GitHub
parent a914db55e7
commit b05e066ff7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 12
      apps/explorer/lib/explorer/etherscan.ex

@ -4,7 +4,7 @@ defmodule Explorer.Etherscan do
"""
import Ecto.Query,
only: [from: 2, where: 3, union: 2, subquery: 1, order_by: 3, limit: 2, offset: 2, preload: 3]
only: [from: 2, where: 3, union: 2, subquery: 1, order_by: 3, limit: 2, offset: 2, preload: 3, select_merge: 3]
import Explorer.Chain.SmartContract, only: [burn_address_hash_string: 0]
@ -555,13 +555,19 @@ defmodule Explorer.Etherscan do
token_name: tkn.name,
token_symbol: tkn.symbol,
token_decimals: tkn.decimals,
token_type: tkn.type,
token_log_index: tt.log_index
})
)
tt_query_with_token_type =
if DenormalizationHelper.tt_denormalization_finished?() do
select_merge(tt_query, [tt, _tkn], %{token_type: tt.token_type})
else
select_merge(tt_query, [_tt, tkn], %{token_type: tkn.type})
end
tt_specific_token_query =
tt_query
tt_query_with_token_type
|> where_start_block_match_tt(options)
|> where_end_block_match_tt(options)
|> where_contract_address_match(contract_address_hash)

Loading…
Cancel
Save