modify query to fetch failed contract creations

pull/1621/head
Ayrat Badykov 6 years ago
parent 318bd429d2
commit a8b108f299
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 8
      apps/indexer/lib/indexer/temporary/failed_created_addresses.ex

@ -8,7 +8,7 @@ defmodule Indexer.Temporary.FailedCreatedAddresses do
import Ecto.Query
alias Explorer.Chain.{InternalTransaction, Transaction}
alias Explorer.Chain.{Address, Data, InternalTransaction, Transaction}
alias Explorer.Repo
alias Indexer.Temporary.FailedCreatedAddresses.TaskSupervisor
@ -45,11 +45,15 @@ defmodule Indexer.Temporary.FailedCreatedAddresses do
fetcher: :failed_created_addresses
)
data = %Data{bytes: ""}
query =
from(t in Transaction,
left_join: it in InternalTransaction,
on: it.transaction_hash == t.hash,
where: t.status == ^0 and not is_nil(it.created_contract_address_hash),
left_join: address in Address,
on: address.hash == it.created_contract_address_hash,
where: t.status == ^0 and not is_nil(it.created_contract_address_hash) and address.contract_code != ^data,
distinct: t.hash
)

Loading…
Cancel
Save