diff --git a/apps/block_scout_web/test/block_scout_web/controllers/api/v2/verification_controller_test.exs b/apps/block_scout_web/test/block_scout_web/controllers/api/v2/verification_controller_test.exs index bd471e8d77..ddefb7e3b1 100644 --- a/apps/block_scout_web/test/block_scout_web/controllers/api/v2/verification_controller_test.exs +++ b/apps/block_scout_web/test/block_scout_web/controllers/api/v2/verification_controller_test.exs @@ -7,6 +7,15 @@ defmodule BlockScoutWeb.API.V2.VerificationControllerTest do @moduletag timeout: :infinity + setup do + configuration = Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour) + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, enabled: false) + + on_exit(fn -> + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, configuration) + end) + end + describe "/api/v2/smart-contracts/verification/config" do test "get cfg", %{conn: conn} do request = get(conn, "/api/v2/smart-contracts/verification/config") diff --git a/apps/block_scout_web/test/block_scout_web/features/address_contract_verification_test.exs b/apps/block_scout_web/test/block_scout_web/features/address_contract_verification_test.exs index 8ea3e75118..bfad4cf065 100644 --- a/apps/block_scout_web/test/block_scout_web/features/address_contract_verification_test.exs +++ b/apps/block_scout_web/test/block_scout_web/features/address_contract_verification_test.exs @@ -8,8 +8,15 @@ defmodule BlockScoutWeb.AddressContractVerificationTest do setup do bypass = Bypass.open() + configuration = Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour) + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, enabled: false) + Application.put_env(:explorer, :solc_bin_api_url, "http://localhost:#{bypass.port}") + on_exit(fn -> + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, configuration) + end) + {:ok, bypass: bypass} end diff --git a/apps/explorer/test/explorer/smart_contract/compiler_version_test.exs b/apps/explorer/test/explorer/smart_contract/compiler_version_test.exs index 02e396d866..86ec4c3d8b 100644 --- a/apps/explorer/test/explorer/smart_contract/compiler_version_test.exs +++ b/apps/explorer/test/explorer/smart_contract/compiler_version_test.exs @@ -6,6 +6,15 @@ defmodule Explorer.SmartContract.CompilerVersionTest do alias Explorer.SmartContract.CompilerVersion alias Plug.Conn + setup do + configuration = Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour) + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, enabled: false) + + on_exit(fn -> + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, configuration) + end) + end + describe "fetch_versions/1" do setup do bypass = Bypass.open() diff --git a/apps/explorer/test/explorer/smart_contract/solidity/publisher_test.exs b/apps/explorer/test/explorer/smart_contract/solidity/publisher_test.exs index 74cf6befed..5cc612bb45 100644 --- a/apps/explorer/test/explorer/smart_contract/solidity/publisher_test.exs +++ b/apps/explorer/test/explorer/smart_contract/solidity/publisher_test.exs @@ -11,6 +11,15 @@ defmodule Explorer.SmartContract.Solidity.PublisherTest do alias Explorer.{Factory, Repo} alias Explorer.SmartContract.Solidity.Publisher + setup do + configuration = Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour) + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, enabled: false) + + on_exit(fn -> + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, configuration) + end) + end + describe "publish/2" do test "with valid data creates a smart_contract" do contract_code_info = Factory.contract_code_info_modern_compiler() diff --git a/apps/explorer/test/explorer/smart_contract/solidity/verifier_test.exs b/apps/explorer/test/explorer/smart_contract/solidity/verifier_test.exs index 71c6b6fd92..25eb232962 100644 --- a/apps/explorer/test/explorer/smart_contract/solidity/verifier_test.exs +++ b/apps/explorer/test/explorer/smart_contract/solidity/verifier_test.exs @@ -61,6 +61,15 @@ defmodule Explorer.SmartContract.Solidity.VerifierTest do } """ + setup do + configuration = Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour) + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, enabled: false) + + on_exit(fn -> + Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, configuration) + end) + end + describe "evaluate_authenticity/2" do setup do {:ok, contract_code_info: Factory.contract_code_info()} diff --git a/config/runtime.exs b/config/runtime.exs index 39a2dd0945..bdb9f9c055 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -422,7 +422,7 @@ config :explorer, Explorer.ThirdPartyIntegrations.NovesFi, chain_name: System.get_env("NOVES_FI_CHAIN_NAME"), api_key: System.get_env("NOVES_FI_API_TOKEN") -enabled? = ConfigHelper.parse_bool_env_var("MICROSERVICE_SC_VERIFIER_ENABLED") +enabled? = ConfigHelper.parse_bool_env_var("MICROSERVICE_SC_VERIFIER_ENABLED", "true") # or "eth_bytecode_db" type = System.get_env("MICROSERVICE_SC_VERIFIER_TYPE", "sc_verifier")