|
|
@ -239,27 +239,26 @@ defmodule Indexer.Fetcher.InternalTransaction do |
|
|
|
|
|
|
|
|
|
|
|
defp remove_failed_creations(internal_transactions_params) do |
|
|
|
defp remove_failed_creations(internal_transactions_params) do |
|
|
|
internal_transactions_params |
|
|
|
internal_transactions_params |
|
|
|
|> Enum.map(fn internal_transaction_params -> |
|
|
|
|> Enum.map(fn internal_transaction_param -> |
|
|
|
internal_transaction_params[:trace_address] |
|
|
|
transaction_index = internal_transaction_param[:transaction_index] |
|
|
|
|
|
|
|
|
|
|
|
failed_parent_index = |
|
|
|
failed_parent = |
|
|
|
Enum.find(internal_transaction_params[:trace_address], fn trace_address -> |
|
|
|
internal_transactions_params |
|
|
|
parent = Enum.at(internal_transactions_params, trace_address) |
|
|
|
|> Enum.filter(fn internal_transactions_param -> |
|
|
|
|
|
|
|
internal_transactions_param[:transaction_index] == transaction_index && |
|
|
|
!is_nil(parent[:error]) |
|
|
|
internal_transactions_param[:trace_address] == [] && !is_nil(internal_transactions_param[:error]) |
|
|
|
end) |
|
|
|
end) |
|
|
|
|
|
|
|
|> Enum.at(0) |
|
|
|
failed_parent = failed_parent_index && Enum.at(internal_transactions_params, failed_parent_index) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if failed_parent do |
|
|
|
if failed_parent do |
|
|
|
internal_transaction_params |
|
|
|
internal_transaction_param |
|
|
|
|> Map.delete(:created_contract_address_hash) |
|
|
|
|> Map.delete(:created_contract_address_hash) |
|
|
|
|> Map.delete(:created_contract_code) |
|
|
|
|> Map.delete(:created_contract_code) |
|
|
|
|> Map.delete(:gas_used) |
|
|
|
|> Map.delete(:gas_used) |
|
|
|
|> Map.delete(:output) |
|
|
|
|> Map.delete(:output) |
|
|
|
|> Map.put(:error, failed_parent[:error]) |
|
|
|
|> Map.put(:error, failed_parent[:error]) |
|
|
|
else |
|
|
|
else |
|
|
|
internal_transaction_params |
|
|
|
internal_transaction_param |
|
|
|
end |
|
|
|
end |
|
|
|
end) |
|
|
|
end) |
|
|
|
end |
|
|
|
end |
|
|
|