Refactor Indexer.Fetcher.TokenInstance naming

pull/7286/head
Nikita Pozdniakov 2 years ago
parent e74384df81
commit 7ea1863d82
No known key found for this signature in database
GPG Key ID: F344106F9804FE5F
  1. 2
      apps/explorer/lib/explorer/token/instance_metadata_retriever.ex
  2. 4
      apps/indexer/lib/indexer/block/fetcher.ex
  3. 2
      apps/indexer/lib/indexer/fetcher/token_instance/helper.ex
  4. 4
      apps/indexer/lib/indexer/fetcher/token_instance/realtime.ex
  5. 4
      apps/indexer/lib/indexer/fetcher/token_instance/retry.ex
  6. 4
      apps/indexer/lib/indexer/fetcher/token_instance/sanitize.ex
  7. 12
      apps/indexer/lib/indexer/supervisor.ex
  8. 12
      config/runtime.exs

@ -65,7 +65,7 @@ defmodule Explorer.Token.InstanceMetadataRetriever do
# https://eips.ethereum.org/EIPS/eip-1155#metadata
@erc1155_token_id_placeholder "{id}"
@max_error_length 100
@max_error_length 255
@ignored_hosts ["localhost", "127.0.0.1", "0.0.0.0", "", nil]

@ -22,10 +22,10 @@ defmodule Indexer.Block.Fetcher do
CoinBalance,
ContractCode,
InternalTransaction,
Realtime.TokenInstance,
ReplacedTransaction,
Token,
TokenBalance,
TokenInstance.Realtime,
UncleBlock
}
@ -253,7 +253,7 @@ defmodule Indexer.Block.Fetcher do
end
def async_import_token_instances(%{token_transfers: token_transfers}) do
TokenInstance.async_fetch(token_transfers)
Realtime.async_fetch(token_transfers)
end
def async_import_token_instances(_), do: :ok

@ -1,4 +1,4 @@
defmodule Indexer.Fetcher.TokenInstance do
defmodule Indexer.Fetcher.TokenInstance.Helper do
@moduledoc """
Common functions for Indexer.Fetcher.TokenInstance fetchers
"""

@ -1,4 +1,4 @@
defmodule Indexer.Fetcher.Realtime.TokenInstance do
defmodule Indexer.Fetcher.TokenInstance.Realtime do
@moduledoc """
Fetches information about a token instance.
"""
@ -6,7 +6,7 @@ defmodule Indexer.Fetcher.Realtime.TokenInstance do
use Indexer.Fetcher, restart: :permanent
use Spandex.Decorators
import Indexer.Fetcher.TokenInstance
import Indexer.Fetcher.TokenInstance.Helper
alias Explorer.Chain
alias Indexer.BufferedTask

@ -1,4 +1,4 @@
defmodule Indexer.Fetcher.Retry.TokenInstance do
defmodule Indexer.Fetcher.TokenInstance.Retry do
@moduledoc """
Fetches information about a token instance.
"""
@ -6,7 +6,7 @@ defmodule Indexer.Fetcher.Retry.TokenInstance do
use Indexer.Fetcher, restart: :permanent
use Spandex.Decorators
import Indexer.Fetcher.TokenInstance
import Indexer.Fetcher.TokenInstance.Helper
alias Explorer.Chain
alias Indexer.BufferedTask

@ -1,4 +1,4 @@
defmodule Indexer.Fetcher.Sanitize.TokenInstance do
defmodule Indexer.Fetcher.TokenInstance.Sanitize do
@moduledoc """
Fetches information about a token instance.
"""
@ -6,7 +6,7 @@ defmodule Indexer.Fetcher.Sanitize.TokenInstance do
use Indexer.Fetcher, restart: :permanent
use Spandex.Decorators
import Indexer.Fetcher.TokenInstance
import Indexer.Fetcher.TokenInstance.Helper
alias Explorer.Chain
alias Indexer.BufferedTask

@ -22,12 +22,12 @@ defmodule Indexer.Supervisor do
InternalTransaction,
PendingBlockOperationsSanitizer,
PendingTransaction,
Realtime,
ReplacedTransaction,
Retry,
Sanitize,
Token,
TokenBalance,
TokenInstance.Realtime,
TokenInstance.Retry,
TokenInstance.Sanitize,
TokenUpdater,
TransactionAction,
UncleBlock
@ -109,15 +109,15 @@ defmodule Indexer.Supervisor do
{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]]},
{Retry.TokenInstance.Supervisor,
{Retry.Supervisor,
[
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]},
{Realtime.TokenInstance.Supervisor,
{Realtime.Supervisor,
[
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]},
{Sanitize.TokenInstance.Supervisor,
{Sanitize.Supervisor,
[
[json_rpc_named_arguments: json_rpc_named_arguments, memory_monitor: memory_monitor]
]},

@ -435,13 +435,13 @@ config :indexer, Indexer.Fetcher.EmptyBlocksSanitizer.Supervisor,
config :indexer, Indexer.Block.Realtime.Supervisor,
enabled: !ConfigHelper.parse_bool_env_var("DISABLE_REALTIME_INDEXER")
config :indexer, Indexer.Fetcher.Realtime.TokenInstance.Supervisor,
config :indexer, Indexer.Fetcher.TokenInstance.Realtime.Supervisor,
disabled?: ConfigHelper.parse_bool_env_var("INDEXER_DISABLE_TOKEN_INSTANCE_REALTIME_FETCHER")
config :indexer, Indexer.Fetcher.Retry.TokenInstance.Supervisor,
config :indexer, Indexer.Fetcher.TokenInstance.Retry.Supervisor,
disabled?: ConfigHelper.parse_bool_env_var("INDEXER_DISABLE_TOKEN_INSTANCE_RETRY_FETCHER")
config :indexer, Indexer.Fetcher.Sanitize.TokenInstance.Supervisor,
config :indexer, Indexer.Fetcher.TokenInstance.Sanitize.Supervisor,
disabled?: ConfigHelper.parse_bool_env_var("INDEXER_DISABLE_TOKEN_INSTANCE_SANITIZE_FETCHER")
config :indexer, Indexer.Fetcher.EmptyBlocksSanitizer,
@ -458,14 +458,14 @@ config :indexer, Indexer.Fetcher.BlockReward,
batch_size: ConfigHelper.parse_integer_env_var("INDEXER_BLOCK_REWARD_BATCH_SIZE", 10),
concurrency: ConfigHelper.parse_integer_env_var("INDEXER_BLOCK_REWARD_CONCURRENCY", 4)
config :indexer, Indexer.Fetcher.Retry.TokenInstance,
config :indexer, Indexer.Fetcher.TokenInstance.Retry,
concurrency: ConfigHelper.parse_integer_env_var("INDEXER_TOKEN_INSTANCE_RETRY_CONCURRENCY", 10),
refetch_interval: ConfigHelper.parse_time_env_var("INDEXER_TOKEN_INSTANCE_RETRY_REFETCH_INTERVAL", "24h")
config :indexer, Indexer.Fetcher.Realtime.TokenInstance,
config :indexer, Indexer.Fetcher.TokenInstance.Realtime,
concurrency: ConfigHelper.parse_integer_env_var("INDEXER_TOKEN_INSTANCE_REALTIME_CONCURRENCY", 10)
config :indexer, Indexer.Fetcher.Sanitize.TokenInstance,
config :indexer, Indexer.Fetcher.TokenInstance.Sanitize,
concurrency: ConfigHelper.parse_integer_env_var("INDEXER_TOKEN_INSTANCE_SANITIZE_CONCURRENCY", 10)
config :indexer, Indexer.Fetcher.InternalTransaction,

Loading…
Cancel
Save