From a0eecb8c5ee816769317be02bf62045dc759ffad Mon Sep 17 00:00:00 2001 From: Viktor Baranov Date: Thu, 16 Mar 2023 22:46:30 +0300 Subject: [PATCH] Resolve mix credo warning --- .../block_scout_web/controllers/smart_contract_controller.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex index d164f4f30a..d17653bf7a 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/smart_contract_controller.ex @@ -24,7 +24,7 @@ defmodule BlockScoutWeb.SmartContractController do {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), {:ok, address} <- Chain.find_contract_address(address_hash, address_options, true), {:contract_interaction_disabled, false} <- - {:contract_interaction_disabled, AddressView.contract_interaction_disabled?() && action == "write"} do + {:contract_interaction_disabled, write_contract_api_disabled?(action)} do implementation_address_hash_string = if contract_type == "proxy" do address.smart_contract @@ -256,4 +256,6 @@ defmodule BlockScoutWeb.SmartContractController do defp is_integer?(integer) when is_integer(integer), do: true defp is_integer?(_), do: false + + defp write_contract_api_disabled?(action), do: AddressView.contract_interaction_disabled?() && action == "write" end