diff --git a/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs b/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs index bb223077a2..3c1e7af4f8 100644 --- a/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs +++ b/apps/block_scout_web/test/block_scout_web/features/viewing_addresses_test.exs @@ -3,6 +3,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do # Because ETS tables is shared for `Explorer.Counters.*` async: false + alias Explorer.Chain.Address alias Explorer.Counters.AddressesCounter alias BlockScoutWeb.{AddressPage, AddressView, Notifier} @@ -69,10 +70,10 @@ defmodule BlockScoutWeb.ViewingAddressesTest do end test "viewing address overview information", %{session: session} do - address = insert(:address, fetched_coin_balance: 500) + address = insert(:address, fetched_coin_balance: 500, hash: Address.checksum(address_hash())) session - |> AddressPage.visit_page(address) + |> AddressPage.visit_page(address.hash) |> assert_text(AddressPage.balance(), "0.0000000000000005 Ether") end @@ -95,7 +96,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do transaction_hash = AddressView.trimmed_hash(transaction.hash) session - |> AddressPage.visit_page(internal_transaction.created_contract_address) + |> AddressPage.visit_page(Address.checksum(internal_transaction.created_contract_address)) |> assert_text(AddressPage.contract_creator(), "#{address_hash} at #{transaction_hash}") end @@ -128,7 +129,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do transaction_hash = AddressView.trimmed_hash(transaction.hash) session - |> AddressPage.visit_page(internal_transaction.created_contract_address) + |> AddressPage.visit_page(Address.checksum(internal_transaction.created_contract_address)) |> assert_text(AddressPage.contract_creator(), "#{contract_hash} at #{transaction_hash}") end end @@ -140,7 +141,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do transactions: transactions } do session - |> AddressPage.visit_page(addresses.lincoln) + |> AddressPage.visit_page(Address.checksum(addresses.lincoln)) |> assert_has(AddressPage.transaction(transactions.from_taft)) |> assert_has(AddressPage.transaction(transactions.from_lincoln)) |> assert_has(AddressPage.transaction_status(transactions.from_lincoln)) @@ -152,7 +153,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do transactions: transactions } do session - |> AddressPage.visit_page(addresses.lincoln) + |> AddressPage.visit_page(Address.checksum(addresses.lincoln)) |> AddressPage.apply_filter("From") |> assert_has(AddressPage.transaction(transactions.from_lincoln)) |> refute_has(AddressPage.transaction(transactions.from_taft)) @@ -164,7 +165,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do transactions: transactions } do session - |> AddressPage.visit_page(addresses.lincoln) + |> AddressPage.visit_page(Address.checksum(addresses.lincoln)) |> AddressPage.apply_filter("To") |> refute_has(AddressPage.transaction(transactions.from_lincoln)) |> assert_has(AddressPage.transaction(transactions.from_taft)) @@ -176,7 +177,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do transactions: transactions } do session - |> AddressPage.visit_page(addresses.lincoln) + |> AddressPage.visit_page(Address.checksum(addresses.lincoln)) |> assert_has(AddressPage.transaction_address_link(transactions.from_lincoln, :to)) |> refute_has(AddressPage.transaction_address_link(transactions.from_lincoln, :from)) end @@ -189,7 +190,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do Application.put_env(:block_scout_web, BlockScoutWeb.Chain, has_emission_funds: true) session - |> AddressPage.visit_page(addresses.lincoln) + |> AddressPage.visit_page(Address.checksum(addresses.lincoln)) |> assert_has(AddressPage.transaction(transactions.from_taft)) |> assert_has(AddressPage.transaction(transactions.from_lincoln)) @@ -228,7 +229,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do session: session } do session - |> AddressPage.visit_page(addresses.lincoln) + |> AddressPage.visit_page(Address.checksum(addresses.lincoln)) |> AddressPage.click_internal_transactions() |> assert_has(AddressPage.internal_transaction_address_link(internal_transaction, :from)) |> refute_has(AddressPage.internal_transaction_address_link(internal_transaction, :to)) @@ -241,7 +242,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do |> with_block(insert(:block, number: 7000)) session - |> AddressPage.visit_page(addresses.lincoln) + |> AddressPage.visit_page(Address.checksum(addresses.lincoln)) |> AddressPage.click_internal_transactions() |> assert_has(AddressPage.internal_transactions(count: 2)) @@ -288,7 +289,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do ) session - |> AddressPage.visit_page(lincoln) + |> AddressPage.visit_page(Address.checksum(lincoln)) |> assert_has(AddressPage.token_transfers(transaction, count: 1)) |> assert_has(AddressPage.token_transfer(transaction, lincoln, count: 1)) |> assert_has(AddressPage.token_transfer(transaction, taft, count: 1)) @@ -363,7 +364,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do ) session - |> AddressPage.visit_page(lincoln) + |> AddressPage.visit_page(Address.checksum(lincoln)) |> assert_has(AddressPage.token_transfers(transaction, count: 1)) end @@ -393,7 +394,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do ) session - |> AddressPage.visit_page(lincoln) + |> AddressPage.visit_page(Address.checksum(lincoln)) |> click(AddressPage.token_transfers_expansion(transaction)) |> assert_has(AddressPage.token_transfers(transaction, count: 3)) end @@ -427,7 +428,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do insert(:address_current_token_balance, address: lincoln, token_contract_address_hash: contract_address.hash) session - |> AddressPage.visit_page(lincoln) + |> AddressPage.visit_page(Address.checksum(lincoln)) |> AddressPage.click_tokens() |> AddressPage.click_token_transfers(token) |> assert_has(AddressPage.token_transfers(transaction, count: 1)) @@ -484,7 +485,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do test "filter tokens balances by token name", %{session: session, lincoln: lincoln} do session - |> AddressPage.visit_page(lincoln) + |> AddressPage.visit_page(Address.checksum(lincoln)) |> AddressPage.click_balance_dropdown_toggle() |> AddressPage.fill_balance_dropdown_search("ato") |> assert_has(AddressPage.token_balance(count: 2)) @@ -526,7 +527,7 @@ defmodule BlockScoutWeb.ViewingAddressesTest do test "see list of coin balances", %{session: session, address: address} do session - |> AddressPage.visit_page(address) + |> AddressPage.visit_page(Address.checksum(address)) |> AddressPage.click_coin_balance_history() |> assert_has(AddressPage.coin_balances(count: 2)) end