|
|
|
@ -7,6 +7,7 @@ defmodule Explorer.Migrator.SanitizeDuplicatedLogIndexLogsTest do |
|
|
|
|
alias Explorer.Chain.Token.Instance |
|
|
|
|
alias Explorer.Migrator.{SanitizeDuplicatedLogIndexLogs, MigrationStatus} |
|
|
|
|
|
|
|
|
|
if Application.compile_env(:explorer, :chain_type) != :celo do |
|
|
|
|
describe "Sanitize duplicated log index logs" do |
|
|
|
|
test "correctly identifies and updates duplicated log index logs" do |
|
|
|
|
block = insert(:block) |
|
|
|
@ -28,7 +29,8 @@ defmodule Explorer.Migrator.SanitizeDuplicatedLogIndexLogsTest do |
|
|
|
|
assert MigrationStatus.get_status("sanitize_duplicated_log_index_logs") == "completed" |
|
|
|
|
assert BackgroundMigrations.get_sanitize_duplicated_log_index_logs_finished() == true |
|
|
|
|
|
|
|
|
|
updated_logs = Repo.all(Log |> where([log], log.block_number == ^block.number) |> order_by([log], asc: log.index)) |
|
|
|
|
updated_logs = |
|
|
|
|
Repo.all(Log |> where([log], log.block_number == ^block.number) |> order_by([log], asc: log.index)) |
|
|
|
|
|
|
|
|
|
assert match?( |
|
|
|
|
[ |
|
|
|
@ -106,7 +108,8 @@ defmodule Explorer.Migrator.SanitizeDuplicatedLogIndexLogsTest do |
|
|
|
|
assert MigrationStatus.get_status("sanitize_duplicated_log_index_logs") == "completed" |
|
|
|
|
assert BackgroundMigrations.get_sanitize_duplicated_log_index_logs_finished() == true |
|
|
|
|
|
|
|
|
|
updated_logs = Repo.all(Log |> where([log], log.block_number == ^block.number) |> order_by([log], asc: log.index)) |
|
|
|
|
updated_logs = |
|
|
|
|
Repo.all(Log |> where([log], log.block_number == ^block.number) |> order_by([log], asc: log.index)) |
|
|
|
|
|
|
|
|
|
assert match?( |
|
|
|
|
[ |
|
|
|
@ -141,4 +144,5 @@ defmodule Explorer.Migrator.SanitizeDuplicatedLogIndexLogsTest do |
|
|
|
|
assert BackgroundMigrations.get_sanitize_duplicated_log_index_logs_finished() == true |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|