diff --git a/apps/explorer_web/priv/gettext/default.pot b/apps/explorer_web/priv/gettext/default.pot index 55bb04f70b..b3f7e8801e 100644 --- a/apps/explorer_web/priv/gettext/default.pot +++ b/apps/explorer_web/priv/gettext/default.pot @@ -171,7 +171,7 @@ msgstr "" #: lib/explorer_web/templates/transaction/overview.html.eex:47 #: lib/explorer_web/templates/transaction/show.html.eex:26 #: lib/explorer_web/views/address_internal_transaction_view.ex:7 -#: lib/explorer_web/views/address_transaction_view.ex:15 +#: lib/explorer_web/views/address_transaction_view.ex:13 msgid "From" msgstr "" @@ -194,7 +194,7 @@ msgstr "" #: lib/explorer_web/templates/transaction/overview.html.eex:61 #: lib/explorer_web/templates/transaction/show.html.eex:27 #: lib/explorer_web/views/address_internal_transaction_view.ex:6 -#: lib/explorer_web/views/address_transaction_view.ex:14 +#: lib/explorer_web/views/address_transaction_view.ex:12 msgid "To" msgstr "" @@ -382,7 +382,7 @@ msgstr "" #: lib/explorer_web/templates/address_internal_transaction/index.html.eex:28 #: lib/explorer_web/templates/address_transaction/index.html.eex:29 #: lib/explorer_web/views/address_internal_transaction_view.ex:8 -#: lib/explorer_web/views/address_transaction_view.ex:16 +#: lib/explorer_web/views/address_transaction_view.ex:14 msgid "All" msgstr "" diff --git a/apps/explorer_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/explorer_web/priv/gettext/en/LC_MESSAGES/default.po index 7142e863a5..0d7fe3604e 100644 --- a/apps/explorer_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/explorer_web/priv/gettext/en/LC_MESSAGES/default.po @@ -183,7 +183,7 @@ msgstr "Address" #: lib/explorer_web/templates/transaction/overview.html.eex:47 #: lib/explorer_web/templates/transaction/show.html.eex:26 #: lib/explorer_web/views/address_internal_transaction_view.ex:7 -#: lib/explorer_web/views/address_transaction_view.ex:15 +#: lib/explorer_web/views/address_transaction_view.ex:13 msgid "From" msgstr "From" @@ -206,7 +206,7 @@ msgstr "Success" #: lib/explorer_web/templates/transaction/overview.html.eex:61 #: lib/explorer_web/templates/transaction/show.html.eex:27 #: lib/explorer_web/views/address_internal_transaction_view.ex:6 -#: lib/explorer_web/views/address_transaction_view.ex:14 +#: lib/explorer_web/views/address_transaction_view.ex:12 msgid "To" msgstr "To" @@ -394,7 +394,7 @@ msgstr "" #: lib/explorer_web/templates/address_internal_transaction/index.html.eex:28 #: lib/explorer_web/templates/address_transaction/index.html.eex:29 #: lib/explorer_web/views/address_internal_transaction_view.ex:8 -#: lib/explorer_web/views/address_transaction_view.ex:16 +#: lib/explorer_web/views/address_transaction_view.ex:14 msgid "All" msgstr "" diff --git a/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs index ee8dd81ba6..73d52b0497 100644 --- a/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/address_internal_transaction_controller_test.exs @@ -4,10 +4,17 @@ defmodule ExplorerWeb.AddressInternalTransactionControllerTest do import ExplorerWeb.Router.Helpers, only: [address_internal_transaction_path: 4] describe "GET index/3" do - test "without address", %{conn: conn} do + test "with invalid address hash", %{conn: conn} do conn = conn - |> get(address_internal_transaction_path(ExplorerWeb.Endpoint, :index, :en, "0xcafe")) + |> get(address_internal_transaction_path(ExplorerWeb.Endpoint, :index, :en, "invalid_address")) + + assert html_response(conn, 404) + end + + test "with valid address hash without address", %{conn: conn} do + conn = + get(conn, address_internal_transaction_path(conn, :index, :en, "0x8bf38d4764929064f2d4d3a56520a76ab3df415b")) assert html_response(conn, 404) end diff --git a/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs index 4a70581ed5..abad5dcb58 100644 --- a/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/address_transaction_controller_test.exs @@ -4,8 +4,14 @@ defmodule ExplorerWeb.AddressTransactionControllerTest do import ExplorerWeb.Router.Helpers, only: [address_transaction_path: 4] describe "GET index/2" do - test "without address", %{conn: conn} do - conn = get(conn, address_transaction_path(conn, :index, :en, "unknown")) + test "with invalid address hash", %{conn: conn} do + conn = get(conn, address_transaction_path(conn, :index, :en, "invalid_address")) + + assert html_response(conn, 404) + end + + test "with valid address hash without address", %{conn: conn} do + conn = get(conn, address_transaction_path(conn, :index, :en, "0x8bf38d4764929064f2d4d3a56520a76ab3df415b")) assert html_response(conn, 404) end diff --git a/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs index ba9c3377a4..6b3b3472bb 100644 --- a/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs @@ -73,8 +73,18 @@ defmodule ExplorerWeb.TransactionControllerTest do end describe "GET show/3" do - test "without transaction", %{conn: conn} do - conn = get(conn, "/en/transactions/0x1") + test "with invalid transaction hash", %{conn: conn} do + conn = get(conn, transaction_path(conn, :show, :en, "invalid_transaction_hash")) + + assert html_response(conn, 404) + end + + test "with valid transaction hash without transaction", %{conn: conn} do + conn = + get( + conn, + transaction_path(conn, :show, :en, "0x3a3eb134e6792ce9403ea4188e5e79693de9e4c94e499db132be086400da79e6") + ) assert html_response(conn, 404) end diff --git a/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs b/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs index e6d25c889e..7688c74ba8 100644 --- a/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs +++ b/apps/explorer_web/test/explorer_web/controllers/transaction_log_controller_test.exs @@ -4,8 +4,18 @@ defmodule ExplorerWeb.TransactionLogControllerTest do import ExplorerWeb.Router.Helpers, only: [transaction_log_path: 4] describe "GET index/2" do - test "without transaction", %{conn: conn} do - conn = get(conn, transaction_log_path(conn, :index, :en, "unknown")) + test "with invalid transaction hash", %{conn: conn} do + conn = get(conn, transaction_log_path(conn, :index, :en, "invalid_transaction_string")) + + assert html_response(conn, 404) + end + + test "with valid transaction hash without transaction", %{conn: conn} do + conn = + get( + conn, + transaction_log_path(conn, :index, :en, "0x3a3eb134e6792ce9403ea4188e5e79693de9e4c94e499db132be086400da79e6") + ) assert html_response(conn, 404) end