Fix failed contract verifications test

pull/2376/head
saneery 5 years ago
parent d3c60b0ec5
commit b717c37c0b
  1. 1
      apps/block_scout_web/lib/block_scout_web.ex
  2. 35
      apps/block_scout_web/lib/block_scout_web/api_router.ex
  3. 5
      apps/block_scout_web/lib/block_scout_web/router.ex

@ -55,6 +55,7 @@ defmodule BlockScoutWeb do
Views.ScriptHelpers, Views.ScriptHelpers,
WeiHelpers WeiHelpers
} }
import BlockScoutWeb.WebRouter.Helpers, except: [static_path: 2] import BlockScoutWeb.WebRouter.Helpers, except: [static_path: 2]
import PhoenixFormAwesomplete import PhoenixFormAwesomplete

@ -11,28 +11,31 @@ defmodule BlockScoutWeb.ApiRouter do
plug(:accepts, ["json"]) plug(:accepts, ["json"])
end end
scope "/v1", BlockScoutWeb.API.V1, as: :api_v1 do scope "/v1", as: :api_v1 do
pipe_through(:api) pipe_through(:api)
get("/supply", SupplyController, :supply) post("/contract_verifications", BlockScoutWeb.AddressContractVerificationController, :create)
get("/health", HealthController, :health) scope "/", BlockScoutWeb.API.V1 do
get("/supply", SupplyController, :supply)
post("/decompiled_smart_contract", DecompiledSmartContractController, :create) get("/health", HealthController, :health)
post("/verified_smart_contracts", VerifiedSmartContractController, :create)
post("/contract_verifications", BlockScoutWeb.AddressContractVerificationController, :create)
post("/eth_rpc", EthController, :eth_request) post("/decompiled_smart_contract", DecompiledSmartContractController, :create)
post("/verified_smart_contracts", VerifiedSmartContractController, :create)
forward("/", RPCTranslator, %{ post("/eth_rpc", EthController, :eth_request)
"block" => RPC.BlockController,
"account" => RPC.AddressController, forward("/", RPCTranslator, %{
"logs" => RPC.LogsController, "block" => RPC.BlockController,
"token" => RPC.TokenController, "account" => RPC.AddressController,
"stats" => RPC.StatsController, "logs" => RPC.LogsController,
"contract" => RPC.ContractController, "token" => RPC.TokenController,
"transaction" => RPC.TransactionController "stats" => RPC.StatsController,
}) "contract" => RPC.ContractController,
"transaction" => RPC.TransactionController
})
end
end end
# Needs to be 200 to support the schema introspection for graphiql # Needs to be 200 to support the schema introspection for graphiql

@ -14,7 +14,7 @@ defmodule BlockScoutWeb.Router do
forward("/wobserver", Wobserver.Web.Router) forward("/wobserver", Wobserver.Web.Router)
forward("/admin", BlockScoutWeb.AdminRouter) forward("/admin", BlockScoutWeb.AdminRouter)
if Application.get_env(:block_scout_web, BlockScoutWeb.ApiRouter, :enabled) do if Application.get_env(:block_scout_web, BlockScoutWeb.ApiRouter)[:enabled] do
forward("/api", BlockScoutWeb.ApiRouter) forward("/api", BlockScoutWeb.ApiRouter)
# For backward compatibility. Should be removed # For backward compatibility. Should be removed
@ -37,8 +37,7 @@ defmodule BlockScoutWeb.Router do
) )
end end
if Application.get_env(:block_scout_web, BlockScoutWeb.WebRouter, :enabled) do if Application.get_env(:block_scout_web, BlockScoutWeb.WebRouter)[:enabled] do
forward("/", BlockScoutWeb.WebRouter) forward("/", BlockScoutWeb.WebRouter)
end end
end end

Loading…
Cancel
Save