From 4b7ac2b1ce5d6489ae2279f2aa3769700328d120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9D=D0=B8=D0=BA=D0=B8=D1=82=D0=B0=20=D0=9F=D0=BE=D0=B7?= =?UTF-8?q?=D0=B4=D0=BD=D1=8F=D0=BA=D0=BE=D0=B2?= Date: Mon, 30 May 2022 18:34:59 +0300 Subject: [PATCH] Fix tests --- CHANGELOG.md | 2 +- .../controllers/tokens/holder_controller_test.exs | 4 ++-- .../controllers/transaction_log_controller_test.exs | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e44dd62d5d..b5039481e2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,8 +16,8 @@ - [#5538](https://github.com/blockscout/blockscout/pull/5538) - Fix internal transaction's tile bug ### Chore -- [#5623](https://github.com/blockscout/blockscout/pull/5623) - Allow hyphen in DB password - [#5625](https://github.com/blockscout/blockscout/pull/5625) - Get rid of some redirects to checksummed address url +- [#5623](https://github.com/blockscout/blockscout/pull/5623) - Allow hyphen in DB password - [#5543](https://github.com/blockscout/blockscout/pull/5543) - Increase max_restarts to 1_000 (from 3 by default) for explorer, block_scout_web supervisors - [#5536](https://github.com/blockscout/blockscout/pull/5536) - NPM audit fix diff --git a/apps/block_scout_web/test/block_scout_web/controllers/tokens/holder_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/tokens/holder_controller_test.exs index ac25b1f0c4..45c23d6f09 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/tokens/holder_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/tokens/holder_controller_test.exs @@ -1,7 +1,7 @@ defmodule BlockScoutWeb.Tokens.HolderControllerTest do use BlockScoutWeb.ConnCase, async: true - alias Explorer.Chain.Hash + alias Explorer.Chain.{Address, Hash} describe "GET index/3" do test "with invalid address hash", %{conn: conn} do @@ -67,7 +67,7 @@ defmodule BlockScoutWeb.Tokens.HolderControllerTest do assert Enum.all?(second_page_token_balances, fn token_balance -> Enum.any?(token_balance_tiles, fn tile -> - String.contains?(tile, to_string(token_balance.address_hash)) + String.contains?(tile, Address.checksum(token_balance.address_hash)) end) end) end diff --git a/apps/block_scout_web/test/block_scout_web/controllers/transaction_log_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/transaction_log_controller_test.exs index f5b6118a2c..fc9ced3bba 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/transaction_log_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/transaction_log_controller_test.exs @@ -5,6 +5,7 @@ defmodule BlockScoutWeb.TransactionLogControllerTest do import BlockScoutWeb.WebRouter.Helpers, only: [transaction_log_path: 3] + alias Explorer.Chain.Address alias Explorer.ExchangeRates.Token describe "GET index/2" do @@ -44,7 +45,7 @@ defmodule BlockScoutWeb.TransactionLogControllerTest do {:ok, %{"items" => items}} = conn.resp_body |> Poison.decode() first_log = List.first(items) - assert String.contains?(first_log, to_string(address.hash)) + assert String.contains?(first_log, Address.checksum(address.hash)) end test "returns logs for the transaction with nil to_address", %{conn: conn} do @@ -67,7 +68,7 @@ defmodule BlockScoutWeb.TransactionLogControllerTest do {:ok, %{"items" => items}} = conn.resp_body |> Poison.decode() first_log = List.first(items) - assert String.contains?(first_log, to_string(address.hash)) + assert String.contains?(first_log, Address.checksum(address.hash)) end test "assigns no logs when there are none", %{conn: conn} do