remove token transfers from regular transaction endpoint

pull/2825/head
Ayrat Badykov 5 years ago
parent ed214fe281
commit ab2476bb71
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 19
      apps/explorer/lib/explorer/chain.ex

@ -304,22 +304,9 @@ defmodule Explorer.Chain do
|> join_associations(necessity_by_association)
|> Transaction.preload_token_transfers(address_hash)
direction_tasks =
base_query
|> Transaction.matching_address_queries_list(direction, address_hash)
|> Enum.map(fn query -> Task.async(fn -> Repo.all(query) end) end)
token_transfers_task =
Task.async(fn ->
transaction_hashes_from_token_transfers =
TokenTransfer.where_any_address_fields_match(direction, address_hash, paging_options)
final_query = where(base_query, [t], t.hash in ^transaction_hashes_from_token_transfers)
Repo.all(final_query)
end)
[token_transfers_task | direction_tasks]
base_query
|> Transaction.matching_address_queries_list(direction, address_hash)
|> Enum.map(fn query -> Task.async(fn -> Repo.all(query) end) end)
end
defp wait_for_address_transactions(tasks) do

Loading…
Cancel
Save