Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikitosing committed Apr 10, 2023
1 parent 10dab6f commit ca493ab
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -299,8 +299,9 @@ defmodule BlockScoutWeb.API.V2.SmartContractControllerTest do
end

test "automatically verify contract via Eth Bytecode Interface", %{conn: conn} do
bypass = Bypass.open()
{:ok, pid} = Explorer.Chain.Fetcher.LookUpSmartContractSourcesOnDemand.start_link([])

bypass = Bypass.open()
eth_bytecode_response = File.read!("./test/support/fixture/smart_contract/eth_bytecode_db_search_response.json")

old_env = Application.get_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour)
Expand Down Expand Up @@ -354,9 +355,12 @@ defmodule BlockScoutWeb.API.V2.SmartContractControllerTest do

Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, old_env)
Bypass.down(bypass)
GenServer.stop(pid)
end

test "check fetch interval for LookUpSmartContractSourcesOnDemand", %{conn: conn} do
{:ok, pid} = Explorer.Chain.Fetcher.LookUpSmartContractSourcesOnDemand.start_link([])

bypass = Bypass.open()
address = insert(:contract_address)

Expand Down Expand Up @@ -402,6 +406,7 @@ defmodule BlockScoutWeb.API.V2.SmartContractControllerTest do
Application.put_env(:explorer, Explorer.Chain.Fetcher.LookUpSmartContractSourcesOnDemand, old_interval_env)
Application.put_env(:explorer, Explorer.SmartContract.RustVerifierInterfaceBehaviour, old_env)
Bypass.down(bypass)
GenServer.stop(pid)
end
end

Expand Down

0 comments on commit ca493ab

Please sign in to comment.