diff --git a/CHANGELOG.md b/CHANGELOG.md index f0b7eb08dd..26514e874f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,6 @@ - [#7545](https://github.com/blockscout/blockscout/pull/7545) - API v2: Check if cached exchange rate is empty before replacing DB value in stats API - [#7516](https://github.com/blockscout/blockscout/pull/7516) - Fix shrinking logo in Safari - [#7590](https://github.com/blockscout/blockscout/pull/7590) - Drop genesis block in internal transactions fetcher -- [#7598](https://github.com/blockscout/blockscout/pull/7598) - Fix created_contract_address_hash detection ### Chore diff --git a/apps/explorer/lib/explorer/chain/import/runner/internal_transactions.ex b/apps/explorer/lib/explorer/chain/import/runner/internal_transactions.ex index 01a0acccc5..684e563c4a 100644 --- a/apps/explorer/lib/explorer/chain/import/runner/internal_transactions.ex +++ b/apps/explorer/lib/explorer/chain/import/runner/internal_transactions.ex @@ -427,28 +427,18 @@ defmodule Explorer.Chain.Import.Runner.InternalTransactions do if valid_internal_transactions_count == 0 do {:ok, nil} else - created_contract_address_hash_map = - valid_internal_transactions - |> Enum.group_by(& &1.transaction_hash) - |> Enum.map(fn {transaction_hash, internal_transactions} -> - {transaction_hash, Enum.find_value(internal_transactions, & &1[:created_contract_address_hash])} - end) - |> Enum.into(%{}) - params = valid_internal_transactions |> Enum.filter(fn internal_tx -> internal_tx[:index] == 0 end) |> Enum.map(fn trace -> - transaction_hash = Map.get(trace, :transaction_hash) - %{ block_hash: Map.get(trace, :block_hash), block_number: Map.get(trace, :block_number), gas_used: Map.get(trace, :gas_used), - transaction_hash: transaction_hash, - created_contract_address_hash: created_contract_address_hash_map[transaction_hash], + transaction_hash: Map.get(trace, :transaction_hash), + created_contract_address_hash: Map.get(trace, :created_contract_address_hash), error: Map.get(trace, :error), status: if(is_nil(Map.get(trace, :error)), do: :ok, else: :error) }