diff --git a/config/runtime.exs b/config/runtime.exs index 8af7b217..4b29e317 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -35,6 +35,9 @@ config :ex_aws, secret_access_key: System.get_env("AWS_SECRET_ACCESS_KEY"), region: System.get_env("AWS_REGION") +config :starknet_explorer, + enable_block_verification: System.get_env("ENABLE_BLOCK_VERIFICATION") || false + if config_env() == :prod do database_url = System.get_env("DATABASE_URL") || @@ -72,7 +75,7 @@ if config_env() == :prod do check_origin: [ "https://madaraexplorer.com", "https://www.madaraexplorer.com", - "https://madaraexplorer.lambdaclass.com", + "https://madaraexplorer.lambdaclass.com" ], http: [ # Enable IPv6 and bind on all interfaces. diff --git a/lib/starknet_explorer_web/live/pages/block_detail.ex b/lib/starknet_explorer_web/live/pages/block_detail.ex index 4741f6a8..a09504e3 100644 --- a/lib/starknet_explorer_web/live/pages/block_detail.ex +++ b/lib/starknet_explorer_web/live/pages/block_detail.ex @@ -83,7 +83,8 @@ defmodule StarknetExplorerWeb.BlockDetailLive do assigns = [ block: block, view: "overview", - verification: "Pending" + verification: "Pending", + enable_verification: Application.get_env(:starknet_explorer, :enable_block_verification) ] {:ok, assign(socket, assigns)} @@ -104,8 +105,6 @@ defmodule StarknetExplorerWeb.BlockDetailLive do @impl true def handle_event("block-verified", %{"result" => result}, socket) do - IO.inspect(result, label: "Block verification result") - verification = case result do true -> @@ -186,25 +185,27 @@ defmodule StarknetExplorerWeb.BlockDetailLive do # Do not hardcode: # - Total Execeution Resources # - Gas Price - def render_info(assigns = %{block: _block, view: "overview"}) do + def render_info(assigns = %{block: _block, view: "overview", enable_verification: _}) do ~H""" -