From a8b108f2995a1579ab9953368f705856dffd5457 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Thu, 21 Mar 2019 12:32:07 +0300 Subject: [PATCH] modify query to fetch failed contract creations --- .../lib/indexer/temporary/failed_created_addresses.ex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/indexer/lib/indexer/temporary/failed_created_addresses.ex b/apps/indexer/lib/indexer/temporary/failed_created_addresses.ex index a07995c4e9..3c11b468b0 100644 --- a/apps/indexer/lib/indexer/temporary/failed_created_addresses.ex +++ b/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 )