diff --git a/apps/block_scout_web/lib/block_scout_web/views/api/v2/transaction_view.ex b/apps/block_scout_web/lib/block_scout_web/views/api/v2/transaction_view.ex index d16281dde8..fa169125fb 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/api/v2/transaction_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/api/v2/transaction_view.ex @@ -408,6 +408,10 @@ defmodule BlockScoutWeb.API.V2.TransactionView do "has_error_in_internal_txs" => transaction.has_error_in_internal_txs } + chain_type_fields(result, transaction, single_tx?, conn) + end + + defp chain_type_fields(result, transaction, single_tx?, conn) do case single_tx? && Application.get_env(:explorer, :chain_type) do "polygon_edge" -> result @@ -423,7 +427,8 @@ defmodule BlockScoutWeb.API.V2.TransactionView do Map.put(extended_result, "zkevm_status", zkevm_status(extended_result)) - _ -> result + _ -> + result end end diff --git a/apps/explorer/lib/explorer/chain.ex b/apps/explorer/lib/explorer/chain.ex index 3bba8d9649..59c2ed8589 100644 --- a/apps/explorer/lib/explorer/chain.ex +++ b/apps/explorer/lib/explorer/chain.ex @@ -6409,42 +6409,4 @@ defmodule Explorer.Chain do def default_paging_options do @default_paging_options end - - def zkevm_batches(options \\ []) do - necessity_by_association = Keyword.get(options, :necessity_by_association, %{}) - - base_query = - from(tb in TransactionBatch, - order_by: [desc: tb.number] - ) - - query = - if Keyword.get(options, :confirmed?, false) do - base_query - |> join_associations(necessity_by_association) - |> where([tb], not is_nil(tb.sequence_id) and tb.sequence_id > 0) - |> limit(10) - else - paging_options = Keyword.get(options, :paging_options, @default_paging_options) - - base_query - |> join_associations(necessity_by_association) - |> page_zkevm_batches(paging_options) - |> limit(^paging_options.page_size) - end - - select_repo(options).all(query) - end - - def zkevm_batch_transactions(batch_number, options \\ []) do - query = from(bts in BatchTransaction, where: bts.batch_number == ^batch_number) - - select_repo(options).all(query) - end - - defp page_zkevm_batches(query, %PagingOptions{key: nil}), do: query - - defp page_zkevm_batches(query, %PagingOptions{key: {number}}) do - from(tb in query, where: tb.number < ^number) - end end diff --git a/apps/explorer/lib/explorer/chain/import/stage/block_referencing.ex b/apps/explorer/lib/explorer/chain/import/stage/block_referencing.ex index 4c3f27e412..1589c95a38 100644 --- a/apps/explorer/lib/explorer/chain/import/stage/block_referencing.ex +++ b/apps/explorer/lib/explorer/chain/import/stage/block_referencing.ex @@ -30,6 +30,7 @@ defmodule Explorer.Chain.Import.Stage.BlockReferencing do Runner.PolygonEdge.Withdrawals, Runner.PolygonEdge.WithdrawalExits ] + "polygon_zkevm" -> @default_runners ++ [ @@ -37,7 +38,9 @@ defmodule Explorer.Chain.Import.Stage.BlockReferencing do Runner.Zkevm.TransactionBatches, Runner.Zkevm.BatchTransactions ] - _ -> @default_runners + + _ -> + @default_runners end end