Finalize bridged tokens

pull/3227/head
Victor Baranov 4 years ago
parent a9bf9d6b0f
commit e9f1b6281a
  1. 1
      .dialyzer-ignore
  2. 4
      apps/block_scout_web/lib/block_scout_web/templates/tokens/overview/_details.html.eex
  3. 12
      apps/block_scout_web/priv/gettext/default.pot
  4. 12
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  5. 2
      apps/indexer/config/config.exs
  6. 13
      apps/indexer/lib/indexer/set_bridged_status_for_tokens.ex
  7. 97
      apps/indexer/lib/indexer/supervisor.ex

@ -2,6 +2,7 @@
:0: Unknown function 'Elixir.ExUnit.CaseTemplate':'__proxy__'/2
:0: Unknown type 'Elixir.Map':t/0
:0: Unknown type 'Elixir.Hash':t/0
:0: Unknown type 'Elixir.Address':t/0
apps/ethereum_jsonrpc/lib/ethereum_jsonrpc.ex:400: Function timestamp_to_datetime/1 has no local return
lib/explorer/repo/prometheus_logger.ex:8
lib/block_scout_web/views/layout_view.ex:175

@ -48,7 +48,9 @@
<span class="mr-4 mb-3 mb-md-0" style="margin-right: 30px;">
Token is bridged
</span>
<a data-test="original_token_contract_address" href=<%= foreign_bridged_token_explorer_link(@token) %> target="_blank">View Original Token <span class="external-token-icon"><%= render BlockScoutWeb.IconsView, "_external_link.html" %></span>
<%= if Map.has_key?(@token, :foreign_token_contract_address_hash) do %>
<a data-test="original_token_contract_address" href=<%= foreign_bridged_token_explorer_link(@token) %> target="_blank">View Original Token <span class="external-token-icon"><%= render BlockScoutWeb.IconsView, "_external_link.html" %></span>
<% end %>
</a>
</div>
<% end %>

@ -1175,7 +1175,7 @@ msgstr ""
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:51
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:94
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:117
msgid "QR Code"
msgstr ""
@ -1446,7 +1446,7 @@ msgid "Topics"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:85
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:87
msgid "Total Supply"
msgstr ""
@ -1601,7 +1601,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:16
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:20
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:65
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:67
msgid "View Contract"
msgstr ""
@ -1715,8 +1715,8 @@ msgstr ""
#: lib/block_scout_web/templates/address/overview.html.eex:142
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:95
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:103
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:116
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:124
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:118
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:126
msgid "Close"
msgstr ""
@ -1733,7 +1733,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:69
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:73
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:75
msgid "Decimals"
msgstr ""

@ -1175,7 +1175,7 @@ msgstr ""
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:51
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:94
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:117
msgid "QR Code"
msgstr ""
@ -1446,7 +1446,7 @@ msgid "Topics"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:85
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:87
msgid "Total Supply"
msgstr ""
@ -1601,7 +1601,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:16
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:20
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:65
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:67
msgid "View Contract"
msgstr ""
@ -1715,8 +1715,8 @@ msgstr ""
#: lib/block_scout_web/templates/address/overview.html.eex:142
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:95
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:103
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:116
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:124
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:118
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:126
msgid "Close"
msgstr ""
@ -1733,7 +1733,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex:69
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:73
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:75
msgid "Decimals"
msgstr ""

@ -44,8 +44,6 @@ config :indexer, Indexer.Fetcher.PendingTransaction.Supervisor,
# config :indexer, Indexer.Fetcher.ReplacedTransaction.Supervisor, disabled?: true
# config :indexer, Indexer.Fetcher.BlockReward.Supervisor, disabled?: true
config :indexer, Indexer.Fetcher.StakingPools.Supervisor, disabled?: true
# System.get_env("MULTI_TOKEN_BRIDGE_MEDIATOR", "") == ""
# config :indexer, Indexer.SetBridgedStatusForTokens.Supervisor, disabled?: true
config :indexer, Indexer.Supervisor, enabled: System.get_env("DISABLE_INDEXER") != "true"

@ -11,19 +11,6 @@ defmodule Indexer.SetBridgedStatusForTokens do
@interval :timer.minutes(1)
# def child_spec([init_arguments]) do
# child_spec([init_arguments, []])
# end
# def child_spec([_init_arguments, _gen_server_options] = start_link_arguments) do
# default = %{
# id: __MODULE__,
# start: {__MODULE__, :start_link, start_link_arguments}
# }
# Supervisor.child_spec(default, [])
# end
def start_link([init_opts, gen_server_opts]) do
start_link(init_opts, gen_server_opts)
end

@ -86,53 +86,58 @@ defmodule Indexer.Supervisor do
realtime_subscribe_named_arguments = realtime_overrides[:subscribe_named_arguments] || subscribe_named_arguments
basic_fetchers = [
# Root fetchers
{PendingTransaction.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments]]},
{Realtime.Supervisor,
[
%{block_fetcher: realtime_block_fetcher, subscribe_named_arguments: realtime_subscribe_named_arguments},
[name: Realtime.Supervisor]
]},
{Catchup.Supervisor,
[
%{block_fetcher: block_fetcher, block_interval: block_interval, memory_monitor: memory_monitor},
[name: Catchup.Supervisor]
]},
# Async catchup fetchers
{UncleBlock.Supervisor, [[block_fetcher: block_fetcher, memory_monitor: memory_monitor]]},
{BlockReward.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{InternalTransaction.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{CoinBalance.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{Token.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenInstance.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{ContractCode.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenBalance.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenUpdater.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{ReplacedTransaction.Supervisor, [[memory_monitor: memory_monitor]]},
{StakingPools.Supervisor, [[memory_monitor: memory_monitor]]},
# Out-of-band fetchers
{CoinBalanceOnDemand.Supervisor, [json_rpc_named_arguments]},
# Temporary workers
{UncatalogedTokenTransfers.Supervisor, [[]]},
{UnclesWithoutIndex.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{BlocksTransactionsMismatch.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{PendingOpsCleaner, [[], []]}
]
multi_token_bridge_mediator = Application.get_env(:block_scout_web, :multi_token_bridge_mediator)
all_fetchers =
if multi_token_bridge_mediator && multi_token_bridge_mediator !== "" do
[{SetBridgedStatusForTokens, [[], []]} | basic_fetchers]
else
basic_fetchers
end
Supervisor.init(
[
# Root fetchers
{PendingTransaction.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments]]},
{Realtime.Supervisor,
[
%{block_fetcher: realtime_block_fetcher, subscribe_named_arguments: realtime_subscribe_named_arguments},
[name: Realtime.Supervisor]
]},
{Catchup.Supervisor,
[
%{block_fetcher: block_fetcher, block_interval: block_interval, memory_monitor: memory_monitor},
[name: Catchup.Supervisor]
]},
# Async catchup fetchers
{UncleBlock.Supervisor, [[block_fetcher: block_fetcher, memory_monitor: memory_monitor]]},
{BlockReward.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{InternalTransaction.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{CoinBalance.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{Token.Supervisor, [[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenInstance.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{ContractCode.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenBalance.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{TokenUpdater.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{ReplacedTransaction.Supervisor, [[memory_monitor: memory_monitor]]},
{StakingPools.Supervisor, [[memory_monitor: memory_monitor]]},
# Out-of-band fetchers
{CoinBalanceOnDemand.Supervisor, [json_rpc_named_arguments]},
{SetBridgedStatusForTokens, [[], []]},
# Temporary workers
{UncatalogedTokenTransfers.Supervisor, [[]]},
{UnclesWithoutIndex.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{BlocksTransactionsMismatch.Supervisor,
[[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]]},
{PendingOpsCleaner, [[], []]}
],
all_fetchers,
strategy: :one_for_one
)
end

Loading…
Cancel
Save