From 2911fc8163f02a87cea5461dc674170c2b6f7e76 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 7 Feb 2020 13:00:27 +0300 Subject: [PATCH] Finalize PR: fix typo and tests --- apps/block_scout_web/config/config.exs | 2 +- .../controllers/address_token_controller_test.exs | 2 +- .../controllers/address_token_transfer_controller_test.exs | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index d48dce4ec8..315d1928e9 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -13,7 +13,7 @@ config :block_scout_web, release_link: System.get_env("RELEASE_LINK"), decompiled_smart_contract_token: System.get_env("DECOMPILED_SMART_CONTRACT_TOKEN"), show_percentage: if(System.get_env("SHOW_ADDRESS_MARKETCAP_PERCENTAGE", "true") == "false", do: false, else: true), - checksum_address_hashed: if(System.get_env("CHECKSUM_ADDRESS_HASHES", "true") == "false", do: false, else: true) + checksum_address_hashes: if(System.get_env("CHECKSUM_ADDRESS_HASHES", "true") == "false", do: false, else: true) config :block_scout_web, BlockScoutWeb.Chain, network: System.get_env("NETWORK"), diff --git a/apps/block_scout_web/test/block_scout_web/controllers/address_token_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/address_token_controller_test.exs index ff2059ed47..4da34ade1a 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/address_token_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/address_token_controller_test.exs @@ -131,7 +131,7 @@ defmodule BlockScoutWeb.AddressTokenControllerTest do insert(:token_transfer, token_contract_address: token.contract_address, from_address: address) end) - conn = get(conn, address_token_path(BlockScoutWeb.Endpoint, :index, to_string(address.hash)), type: "JSON") + conn = get(conn, address_token_path(BlockScoutWeb.Endpoint, :index, Address.checksum(address.hash)), type: "JSON") {:ok, %{"next_page_path" => next_page_path}} = conn.resp_body diff --git a/apps/block_scout_web/test/block_scout_web/controllers/address_token_transfer_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/address_token_transfer_controller_test.exs index 40a1e283ca..ad7f761af7 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/address_token_transfer_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/address_token_transfer_controller_test.exs @@ -25,7 +25,12 @@ defmodule BlockScoutWeb.AddressTokenTransferControllerTest do test "with an address that doesn't exist in our database", %{conn: conn} do address_hash = "0x8bf38d4764929064f2d4d3a56520a76ab3df415b" %Token{contract_address_hash: token_hash} = insert(:token) - conn = get(conn, address_token_transfers_path(conn, :index, Address.checksum(address_hash), token_hash)) + + conn = + get( + conn, + address_token_transfers_path(conn, :index, Address.checksum(address_hash), Address.checksum(token_hash)) + ) assert html_response(conn, 404) end