Finalize PR: fix typo and tests

pull/2834/head
Victor Baranov 5 years ago
parent 3771dda43d
commit 2911fc8163
  1. 2
      apps/block_scout_web/config/config.exs
  2. 2
      apps/block_scout_web/test/block_scout_web/controllers/address_token_controller_test.exs
  3. 7
      apps/block_scout_web/test/block_scout_web/controllers/address_token_transfer_controller_test.exs

@ -13,7 +13,7 @@ config :block_scout_web,
release_link: System.get_env("RELEASE_LINK"), release_link: System.get_env("RELEASE_LINK"),
decompiled_smart_contract_token: System.get_env("DECOMPILED_SMART_CONTRACT_TOKEN"), 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), 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, config :block_scout_web, BlockScoutWeb.Chain,
network: System.get_env("NETWORK"), network: System.get_env("NETWORK"),

@ -131,7 +131,7 @@ defmodule BlockScoutWeb.AddressTokenControllerTest do
insert(:token_transfer, token_contract_address: token.contract_address, from_address: address) insert(:token_transfer, token_contract_address: token.contract_address, from_address: address)
end) 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}} = {:ok, %{"next_page_path" => next_page_path}} =
conn.resp_body conn.resp_body

@ -25,7 +25,12 @@ defmodule BlockScoutWeb.AddressTokenTransferControllerTest do
test "with an address that doesn't exist in our database", %{conn: conn} do test "with an address that doesn't exist in our database", %{conn: conn} do
address_hash = "0x8bf38d4764929064f2d4d3a56520a76ab3df415b" address_hash = "0x8bf38d4764929064f2d4d3a56520a76ab3df415b"
%Token{contract_address_hash: token_hash} = insert(:token) %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) assert html_response(conn, 404)
end end

Loading…
Cancel
Save