Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DaMandal0rian committed May 2, 2024
1 parent be2badc commit f489d93
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
<<<<<<<< HEAD:apps/explorer/lib/explorer/chain/import/runner/polygon_zkevm/batch_transactions.ex
defmodule Explorer.Chain.Import.Runner.PolygonZkevm.BatchTransactions do
@moduledoc """
Bulk imports `t:Explorer.Chain.PolygonZkevm.BatchTransaction.t/0`.
========
defmodule Explorer.Chain.Import.Runner.ZkSync.BatchTransactions do
@moduledoc """
Bulk imports `t:Explorer.Chain.ZkSync.BatchTransaction.t/0`.
>>>>>>>> master:apps/explorer/lib/explorer/chain/import/runner/zksync/batch_transactions.ex
"""

require Ecto.Query

alias Ecto.{Changeset, Multi, Repo}
alias Explorer.Chain.Import
<<<<<<<< HEAD:apps/explorer/lib/explorer/chain/import/runner/polygon_zkevm/batch_transactions.ex
alias Explorer.Chain.PolygonZkevm.BatchTransaction
========
alias Explorer.Chain.ZkSync.BatchTransaction
>>>>>>>> master:apps/explorer/lib/explorer/chain/import/runner/zksync/batch_transactions.ex
alias Explorer.Prometheus.Instrumenter

@behaviour Import.Runner
Expand All @@ -31,11 +21,7 @@ defmodule Explorer.Chain.Import.Runner.ZkSync.BatchTransactions do
def ecto_schema_module, do: BatchTransaction

@impl Import.Runner
<<<<<<<< HEAD:apps/explorer/lib/explorer/chain/import/runner/polygon_zkevm/batch_transactions.ex
def option_key, do: :polygon_zkevm_batch_transactions
========
def option_key, do: :zksync_batch_transactions
>>>>>>>> master:apps/explorer/lib/explorer/chain/import/runner/zksync/batch_transactions.ex

@impl Import.Runner
@spec imported_table_row() :: %{:value_description => binary(), :value_type => binary()}
Expand All @@ -56,21 +42,12 @@ defmodule Explorer.Chain.Import.Runner.ZkSync.BatchTransactions do
|> Map.put_new(:timeout, @timeout)
|> Map.put(:timestamps, timestamps)

<<<<<<<< HEAD:apps/explorer/lib/explorer/chain/import/runner/polygon_zkevm/batch_transactions.ex
Multi.run(multi, :insert_polygon_zkevm_batch_transactions, fn repo, _ ->
Instrumenter.block_import_stage_runner(
fn -> insert(repo, changes_list, insert_options) end,
:block_referencing,
:polygon_zkevm_batch_transactions,
:polygon_zkevm_batch_transactions
========
Multi.run(multi, :insert_zksync_batch_transactions, fn repo, _ ->
Instrumenter.block_import_stage_runner(
fn -> insert(repo, changes_list, insert_options) end,
:block_referencing,
:zksync_batch_transactions,
:zksync_batch_transactions
>>>>>>>> master:apps/explorer/lib/explorer/chain/import/runner/zksync/batch_transactions.ex
)
end)
end
Expand All @@ -82,11 +59,7 @@ defmodule Explorer.Chain.Import.Runner.ZkSync.BatchTransactions do
{:ok, [BatchTransaction.t()]}
| {:error, [Changeset.t()]}
def insert(repo, changes_list, %{timeout: timeout, timestamps: timestamps} = _options) when is_list(changes_list) do
<<<<<<<< HEAD:apps/explorer/lib/explorer/chain/import/runner/polygon_zkevm/batch_transactions.ex
# Enforce PolygonZkevm.BatchTransaction ShareLocks order (see docs: sharelock.md)
========
# Enforce ZkSync.BatchTransaction ShareLocks order (see docs: sharelock.md)
>>>>>>>> master:apps/explorer/lib/explorer/chain/import/runner/zksync/batch_transactions.ex
ordered_changes_list = Enum.sort_by(changes_list, & &1.hash)

{:ok, inserted} =
Expand Down

0 comments on commit f489d93

Please sign in to comment.