Remove unused block import stages (#10875)

pull/10879/head
Victor Baranov 2 months ago committed by GitHub
parent 2c17f34409
commit e22b45f32e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 30
      apps/explorer/lib/explorer/chain/import/stage/address_referencing.ex
  2. 26
      apps/explorer/lib/explorer/chain/import/stage/addresses.ex

@ -1,30 +0,0 @@
defmodule Explorer.Chain.Import.Stage.AddressReferencing do
@moduledoc """
Imports any tables that reference `t:Explorer.Chain.Address.t/0` and that were imported by
`Explorer.Chain.Import.Stage.Addresses`.
"""
alias Explorer.Chain.Import.{Runner, Stage}
@behaviour Stage
@impl Stage
def runners,
do: [
Runner.Address.CoinBalances,
Runner.Blocks,
Runner.Address.CoinBalancesDaily
]
@impl Stage
def all_runners,
do: runners()
@impl Stage
def multis(runner_to_changes_list, options) do
{final_multi, final_remaining_runner_to_changes_list} =
Stage.single_multi(runners(), runner_to_changes_list, options)
{[final_multi], final_remaining_runner_to_changes_list}
end
end

@ -1,26 +0,0 @@
defmodule Explorer.Chain.Import.Stage.Addresses do
@moduledoc """
Imports addresses before anything else that references them because an unused address is still valid and recoverable
if the other stage(s) don't commit.
"""
alias Explorer.Chain.Import.{Runner, Stage}
@behaviour Stage
@runner Runner.Addresses
@impl Stage
def runners, do: [@runner]
@impl Stage
def all_runners,
do: runners()
@chunk_size 50
@impl Stage
def multis(runner_to_changes_list, options) do
Stage.chunk_every(runner_to_changes_list, @runner, @chunk_size, options)
end
end
Loading…
Cancel
Save