Merge pull request #3414 from poanetwork/vb-other-explorers

Manage list of other explorers in the footer via env var
pull/3421/head
Victor Baranov 4 years ago committed by GitHub
commit 9da6e09bf7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      .dialyzer-ignore
  2. 1
      CHANGELOG.md
  3. 6
      apps/block_scout_web/config/config.exs
  4. 8
      apps/block_scout_web/lib/block_scout_web/views/layout_view.ex

@ -15,7 +15,7 @@ lib/block_scout_web/schema/types.ex:31
lib/phoenix/router.ex:324
lib/phoenix/router.ex:402
lib/block_scout_web/views/layout_view.ex:145: The call 'Elixir.Poison.Parser':'parse!'
lib/block_scout_web/views/layout_view.ex:231: The call 'Elixir.Poison.Parser':'parse!'
lib/block_scout_web/views/layout_view.ex:237: The call 'Elixir.Poison.Parser':'parse!'
lib/block_scout_web/controllers/api/rpc/transaction_controller.ex:21
lib/block_scout_web/controllers/api/rpc/transaction_controller.ex:22
lib/explorer/smart_contract/reader.ex:330

@ -40,6 +40,7 @@
- [#3335](https://github.com/poanetwork/blockscout/pull/3335) - MarketCap calculation: check that ETS tables exist before inserting new data or lookup from the table
### Chore
- [#3414](https://github.com/poanetwork/blockscout/pull/3414) - Manage lis of other explorers in the footer via env var
- [#3407](https://github.com/poanetwork/blockscout/pull/3407) - Add EthereumJSONRPC.HTTP.HTTPoison.json_rpc function clause when URL is null
- [#3405](https://github.com/poanetwork/blockscout/pull/3405) - N/A instead of 0 for market cap if it is not fetched
- [#3404](https://github.com/poanetwork/blockscout/pull/3404) - DISABLE_KNOWN_TOKENS env var

@ -29,11 +29,7 @@ config :block_scout_web, BlockScoutWeb.Chain,
config :block_scout_web,
link_to_other_explorers: System.get_env("LINK_TO_OTHER_EXPLORERS") == "true",
other_explorers: %{
"Etherscan" => "https://etherscan.io/",
"EtherChain" => "https://www.etherchain.org/",
"Bloxy" => "https://bloxy.info/"
},
other_explorers: System.get_env("OTHER_EXPLORERS"),
other_networks: System.get_env("SUPPORTED_CHAINS"),
webapp_url: System.get_env("WEBAPP_URL"),
api_url: System.get_env("API_URL"),

@ -197,12 +197,18 @@ defmodule BlockScoutWeb.LayoutView do
def other_explorers do
if Application.get_env(:block_scout_web, :link_to_other_explorers) do
Application.get_env(:block_scout_web, :other_explorers, [])
decode_other_explorers_json(Application.get_env(:block_scout_web, :other_explorers, []))
else
[]
end
end
defp decode_other_explorers_json(data) do
Jason.decode!(~s(#{data}))
rescue
_ -> []
end
def webapp_url(conn) do
:block_scout_web
|> Application.get_env(:webapp_url)

Loading…
Cancel
Save