Change ExplorerWeb to BlockScoutWeb

pull/538/head
Andrew Cravenho 6 years ago committed by Luke Imhoff
parent cf75276fe8
commit 5aa6561edb
  1. 2
      README.md
  2. 14
      apps/block_scout_web/config/config.exs
  3. 4
      apps/block_scout_web/config/dev.exs
  4. 2
      apps/block_scout_web/config/dev.secret.exs.example
  5. 4
      apps/block_scout_web/config/prod.exs
  6. 4
      apps/block_scout_web/config/test.exs
  7. 22
      apps/block_scout_web/lib/block_scout_web.ex
  8. 8
      apps/block_scout_web/lib/block_scout_web/application.ex
  9. 2
      apps/block_scout_web/lib/block_scout_web/chain.ex
  10. 12
      apps/block_scout_web/lib/block_scout_web/channels/address_channel.ex
  11. 8
      apps/block_scout_web/lib/block_scout_web/channels/block_channel.ex
  12. 8
      apps/block_scout_web/lib/block_scout_web/channels/transaction_channel.ex
  13. 8
      apps/block_scout_web/lib/block_scout_web/channels/user_socket.ex
  14. 6
      apps/block_scout_web/lib/block_scout_web/controller.ex
  15. 6
      apps/block_scout_web/lib/block_scout_web/controllers/address_contract_controller.ex
  16. 4
      apps/block_scout_web/lib/block_scout_web/controllers/address_contract_verification_controller.ex
  17. 4
      apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex
  18. 8
      apps/block_scout_web/lib/block_scout_web/controllers/address_internal_transaction_controller.ex
  19. 6
      apps/block_scout_web/lib/block_scout_web/controllers/address_read_contract_controller.ex
  20. 8
      apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex
  21. 4
      apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/address_controller.ex
  22. 6
      apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/block_controller.ex
  23. 4
      apps/block_scout_web/lib/block_scout_web/controllers/api/rpc/rpc_translator.ex
  24. 4
      apps/block_scout_web/lib/block_scout_web/controllers/api/v1/supply_controller.ex
  25. 6
      apps/block_scout_web/lib/block_scout_web/controllers/api_docs_controller.ex
  26. 6
      apps/block_scout_web/lib/block_scout_web/controllers/block_controller.ex
  27. 6
      apps/block_scout_web/lib/block_scout_web/controllers/block_transaction_controller.ex
  28. 6
      apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex
  29. 6
      apps/block_scout_web/lib/block_scout_web/controllers/pending_transaction_controller.ex
  30. 6
      apps/block_scout_web/lib/block_scout_web/controllers/token_controller.ex
  31. 6
      apps/block_scout_web/lib/block_scout_web/controllers/transaction_controller.ex
  32. 6
      apps/block_scout_web/lib/block_scout_web/controllers/transaction_internal_transaction_controller.ex
  33. 6
      apps/block_scout_web/lib/block_scout_web/controllers/transaction_log_controller.ex
  34. 2
      apps/block_scout_web/lib/block_scout_web/csp_header.ex
  35. 6
      apps/block_scout_web/lib/block_scout_web/endpoint.ex
  36. 2
      apps/block_scout_web/lib/block_scout_web/etherscan.ex
  37. 4
      apps/block_scout_web/lib/block_scout_web/event_handler.ex
  38. 2
      apps/block_scout_web/lib/block_scout_web/exchange_rates/usd.ex
  39. 4
      apps/block_scout_web/lib/block_scout_web/gettext.ex
  40. 4
      apps/block_scout_web/lib/block_scout_web/notifier.ex
  41. 18
      apps/block_scout_web/lib/block_scout_web/router.ex
  42. 2
      apps/block_scout_web/lib/block_scout_web/social_media.ex
  43. 4
      apps/block_scout_web/lib/block_scout_web/templates/address/_link.html.eex
  44. 2
      apps/block_scout_web/lib/block_scout_web/templates/address/_responsive_hash.html.eex
  45. 8
      apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex
  46. 2
      apps/block_scout_web/lib/block_scout_web/templates/address_contract/index.html.eex
  47. 14
      apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/_internal_transaction.html.eex
  48. 2
      apps/block_scout_web/lib/block_scout_web/templates/address_internal_transaction/index.html.eex
  49. 2
      apps/block_scout_web/lib/block_scout_web/templates/address_read_contract/index.html.eex
  50. 30
      apps/block_scout_web/lib/block_scout_web/templates/address_transaction/_transaction.html.eex
  51. 2
      apps/block_scout_web/lib/block_scout_web/templates/address_transaction/index.html.eex
  52. 2
      apps/block_scout_web/lib/block_scout_web/templates/api_docs/index.html.eex
  53. 4
      apps/block_scout_web/lib/block_scout_web/templates/block/_tile.html.eex
  54. 2
      apps/block_scout_web/lib/block_scout_web/templates/block/index.html.eex
  55. 2
      apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex
  56. 4
      apps/block_scout_web/lib/block_scout_web/templates/block_transaction/index.html.eex
  57. 4
      apps/block_scout_web/lib/block_scout_web/templates/chain/_block.html.eex
  58. 8
      apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex
  59. 4
      apps/block_scout_web/lib/block_scout_web/templates/layout/app.html.eex
  60. 16
      apps/block_scout_web/lib/block_scout_web/templates/pending_transaction/index.html.eex
  61. 12
      apps/block_scout_web/lib/block_scout_web/templates/token/_token_transfer.html.eex
  62. 2
      apps/block_scout_web/lib/block_scout_web/templates/transaction/_link.html.eex
  63. 18
      apps/block_scout_web/lib/block_scout_web/templates/transaction/_tile.html.eex
  64. 2
      apps/block_scout_web/lib/block_scout_web/templates/transaction/index.html.eex
  65. 8
      apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex
  66. 8
      apps/block_scout_web/lib/block_scout_web/templates/transaction_internal_transaction/_internal_transaction.html.eex
  67. 2
      apps/block_scout_web/lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex
  68. 2
      apps/block_scout_web/lib/block_scout_web/templates/transaction_log/index.html.eex
  69. 4
      apps/block_scout_web/lib/block_scout_web/views/address_contract_verification_view.ex
  70. 6
      apps/block_scout_web/lib/block_scout_web/views/address_contract_view.ex
  71. 6
      apps/block_scout_web/lib/block_scout_web/views/address_internal_transaction_view.ex
  72. 6
      apps/block_scout_web/lib/block_scout_web/views/address_read_contract_view.ex
  73. 6
      apps/block_scout_web/lib/block_scout_web/views/address_transaction_view.ex
  74. 6
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex
  75. 6
      apps/block_scout_web/lib/block_scout_web/views/api/rpc/address_view.ex
  76. 6
      apps/block_scout_web/lib/block_scout_web/views/api/rpc/block_view.ex
  77. 4
      apps/block_scout_web/lib/block_scout_web/views/api/rpc/rpc_view.ex
  78. 4
      apps/block_scout_web/lib/block_scout_web/views/api/v1/supply_view.ex
  79. 4
      apps/block_scout_web/lib/block_scout_web/views/api_docs_view.ex
  80. 6
      apps/block_scout_web/lib/block_scout_web/views/block_transaction_view.ex
  81. 4
      apps/block_scout_web/lib/block_scout_web/views/block_view.ex
  82. 6
      apps/block_scout_web/lib/block_scout_web/views/chain_view.ex
  83. 2
      apps/block_scout_web/lib/block_scout_web/views/cldr/number.ex
  84. 14
      apps/block_scout_web/lib/block_scout_web/views/currency_helpers.ex
  85. 6
      apps/block_scout_web/lib/block_scout_web/views/error_helpers.ex
  86. 4
      apps/block_scout_web/lib/block_scout_web/views/error_view.ex
  87. 4
      apps/block_scout_web/lib/block_scout_web/views/icons_view.ex
  88. 4
      apps/block_scout_web/lib/block_scout_web/views/internal_transaction_view.ex
  89. 6
      apps/block_scout_web/lib/block_scout_web/views/layout_view.ex
  90. 4
      apps/block_scout_web/lib/block_scout_web/views/pending_transaction_view.ex
  91. 6
      apps/block_scout_web/lib/block_scout_web/views/token_helpers.ex
  92. 4
      apps/block_scout_web/lib/block_scout_web/views/token_view.ex
  93. 4
      apps/block_scout_web/lib/block_scout_web/views/transaction_internal_transaction_view.ex
  94. 4
      apps/block_scout_web/lib/block_scout_web/views/transaction_log_view.ex
  95. 10
      apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
  96. 6
      apps/block_scout_web/lib/block_scout_web/views/wei_helpers.ex
  97. 4
      apps/block_scout_web/mix.exs
  98. 4
      apps/block_scout_web/test/explorer_web/chain_test.exs
  99. 8
      apps/block_scout_web/test/explorer_web/channels/address_channel_test.exs
  100. 6
      apps/block_scout_web/test/explorer_web/channels/transaction_channel_test.exs
  101. Some files were not shown because too many files have changed in this diff Show More

@ -102,7 +102,7 @@ Each OTP application has a restricted domain.
|:------------------------|:--------------------|:------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |:------------------------|:--------------------|:------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `apps/ethereum_jsonrpc` | `:ethereum_jsonrpc` | `EthereumJSONRPC` | Ethereum JSONRPC client. It is allowed to know `Explorer`'s param format, but it cannot directly depend on `:explorer` | | `apps/ethereum_jsonrpc` | `:ethereum_jsonrpc` | `EthereumJSONRPC` | Ethereum JSONRPC client. It is allowed to know `Explorer`'s param format, but it cannot directly depend on `:explorer` |
| `apps/explorer` | `:explorer` | `Explorer` | Storage for the indexed chain. Can read and write to the backing storage. MUST be able to boot in a read-only mode when run independently from `:indexer`, so cannot depend on `:indexer` as that would start `:indexer` indexing. | | `apps/explorer` | `:explorer` | `Explorer` | Storage for the indexed chain. Can read and write to the backing storage. MUST be able to boot in a read-only mode when run independently from `:indexer`, so cannot depend on `:indexer` as that would start `:indexer` indexing. |
| `apps/block_scout_web` | `:block_scout_web` | `ExplorerWeb` | Phoenix interface to `:explorer`. The minimum interface to allow web access should go in `:block_scout_web`. Any business rules or interface not tied directly to `Phoenix` or `Plug` should go in `:explorer`. MUST be able to boot in a read-only mode when run independently from `:indexer`, so cannot depend on `:indexer` as that would start `:indexer` indexing. | | `apps/block_scout_web` | `:block_scout_web` | `BlockScoutWeb` | Phoenix interface to `:explorer`. The minimum interface to allow web access should go in `:block_scout_web`. Any business rules or interface not tied directly to `Phoenix` or `Plug` should go in `:explorer`. MUST be able to boot in a read-only mode when run independently from `:indexer`, so cannot depend on `:indexer` as that would start `:indexer` indexing. |
| `apps/indexer` | `:indexer` | `Indexer` | Uses `:ethereum_jsonrpc` to index chain and batch import data into `:explorer`. Any process, `Task`, or `GenServer` that automatically reads from the chain and writes to `:explorer` should be in `:indexer`. This restricts automatic writes to `:indexer` and read-only mode can be achieved by not running `:indexer`. | | `apps/indexer` | `:indexer` | `Indexer` | Uses `:ethereum_jsonrpc` to index chain and batch import data into `:explorer`. Any process, `Task`, or `GenServer` that automatically reads from the chain and writes to `:explorer` should be in `:indexer`. This restricts automatic writes to `:indexer` and read-only mode can be achieved by not running `:indexer`. |

@ -7,19 +7,19 @@ use Mix.Config
# General application configuration # General application configuration
config :block_scout_web, config :block_scout_web,
namespace: ExplorerWeb, namespace: BlockScoutWeb,
ecto_repos: [Explorer.Repo] ecto_repos: [Explorer.Repo]
# Configures the endpoint # Configures the endpoint
config :block_scout_web, ExplorerWeb.Endpoint, config :block_scout_web, BlockScoutWeb.Endpoint,
url: [host: "localhost"], url: [host: "localhost"],
render_errors: [view: ExplorerWeb.ErrorView, accepts: ~w(html json)], render_errors: [view: BlockScoutWeb.ErrorView, accepts: ~w(html json)],
pubsub: [name: ExplorerWeb.PubSub, adapter: Phoenix.PubSub.PG2] pubsub: [name: BlockScoutWeb.PubSub, adapter: Phoenix.PubSub.PG2]
# Configures gettext # Configures gettext
config :block_scout_web, ExplorerWeb.Gettext, locales: ~w(en), default_locale: "en" config :block_scout_web, BlockScoutWeb.Gettext, locales: ~w(en), default_locale: "en"
config :block_scout_web, ExplorerWeb.SocialMedia, config :block_scout_web, BlockScoutWeb.SocialMedia,
twitter: "PoaNetwork", twitter: "PoaNetwork",
telegram: "oraclesnetwork", telegram: "oraclesnetwork",
facebook: "PoaNetwork", facebook: "PoaNetwork",
@ -28,7 +28,7 @@ config :block_scout_web, ExplorerWeb.SocialMedia,
config :ex_cldr, config :ex_cldr,
default_locale: "en", default_locale: "en",
locales: ["en"], locales: ["en"],
gettext: ExplorerWeb.Gettext gettext: BlockScoutWeb.Gettext
# Import environment specific config. This must remain at the bottom # Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above. # of this file so it overrides the configuration defined above.

@ -6,7 +6,7 @@ use Mix.Config
# The watchers configuration can be used to run external # The watchers configuration can be used to run external
# watchers to your application. For example, we use it # watchers to your application. For example, we use it
# with webpack to recompile .js and .css sources. # with webpack to recompile .js and .css sources.
config :block_scout_web, ExplorerWeb.Endpoint, config :block_scout_web, BlockScoutWeb.Endpoint,
http: [port: 4000], http: [port: 4000],
debug_errors: true, debug_errors: true,
code_reloader: true, code_reloader: true,
@ -38,7 +38,7 @@ config :block_scout_web, ExplorerWeb.Endpoint,
# different ports. # different ports.
# Watch static and templates for browser reloading. # Watch static and templates for browser reloading.
config :block_scout_web, ExplorerWeb.Endpoint, config :block_scout_web, BlockScoutWeb.Endpoint,
live_reload: [ live_reload: [
patterns: [ patterns: [
~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$}, ~r{priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$},

@ -1,5 +1,5 @@
use Mix.Config use Mix.Config
# Configures the endpoint # Configures the endpoint
config :block_scout_web, ExplorerWeb.Endpoint, config :block_scout_web, BlockScoutWeb.Endpoint,
secret_key_base: "RMgI4C1HSkxsEjdhtGMfwAHfyT6CKWXOgzCboJflfSm4jeAlic52io05KB6mqzc5" secret_key_base: "RMgI4C1HSkxsEjdhtGMfwAHfyT6CKWXOgzCboJflfSm4jeAlic52io05KB6mqzc5"

@ -3,7 +3,7 @@ use Mix.Config
# For production, we often load configuration from external # For production, we often load configuration from external
# sources, such as your system environment. For this reason, # sources, such as your system environment. For this reason,
# you won't find the :http configuration below, but set inside # you won't find the :http configuration below, but set inside
# ExplorerWeb.Endpoint.init/2 when load_from_system_env is # BlockScoutWeb.Endpoint.init/2 when load_from_system_env is
# true. Any dynamic configuration should be done there. # true. Any dynamic configuration should be done there.
# #
# Don't forget to configure the url host to something meaningful, # Don't forget to configure the url host to something meaningful,
@ -13,7 +13,7 @@ use Mix.Config
# containing the digested version of static files. This # containing the digested version of static files. This
# manifest is generated by the mix phx.digest task # manifest is generated by the mix phx.digest task
# which you typically run after static files are built. # which you typically run after static files are built.
config :block_scout_web, ExplorerWeb.Endpoint, config :block_scout_web, BlockScoutWeb.Endpoint,
cache_static_manifest: "priv/static/cache_manifest.json", cache_static_manifest: "priv/static/cache_manifest.json",
force_ssl: false, force_ssl: false,
secret_key_base: System.get_env("SECRET_KEY_BASE"), secret_key_base: System.get_env("SECRET_KEY_BASE"),

@ -4,7 +4,7 @@ config :block_scout_web, :sql_sandbox, true
# We don't run a server during test. If one is required, # We don't run a server during test. If one is required,
# you can enable the server option below. # you can enable the server option below.
config :block_scout_web, ExplorerWeb.Endpoint, config :block_scout_web, BlockScoutWeb.Endpoint,
http: [port: 4001], http: [port: 4001],
secret_key_base: "27Swe6KtEtmN37WyEYRjKWyxYULNtrxlkCEKur4qoV+Lwtk8lafsR16ifz1XBBYj", secret_key_base: "27Swe6KtEtmN37WyEYRjKWyxYULNtrxlkCEKur4qoV+Lwtk8lafsR16ifz1XBBYj",
server: true server: true
@ -12,4 +12,4 @@ config :block_scout_web, ExplorerWeb.Endpoint,
# Configure wallaby # Configure wallaby
config :wallaby, screenshot_on_failure: true config :wallaby, screenshot_on_failure: true
config :block_scout_web, :fake_adapter, ExplorerWeb.FakeAdapter config :block_scout_web, :fake_adapter, BlockScoutWeb.FakeAdapter

@ -1,12 +1,12 @@
defmodule ExplorerWeb do defmodule BlockScoutWeb do
@moduledoc """ @moduledoc """
The entrypoint for defining your web interface, such The entrypoint for defining your web interface, such
as controllers, views, channels and so on. as controllers, views, channels and so on.
This can be used in your application as: This can be used in your application as:
use ExplorerWeb, :controller use BlockScoutWeb, :controller
use ExplorerWeb, :view use BlockScoutWeb, :view
The definitions below will be executed for every view, The definitions below will be executed for every view,
controller, etc, so keep them short and clean, focused controller, etc, so keep them short and clean, focused
@ -19,12 +19,12 @@ defmodule ExplorerWeb do
def controller do def controller do
quote do quote do
use Phoenix.Controller, namespace: ExplorerWeb use Phoenix.Controller, namespace: BlockScoutWeb
import ExplorerWeb.Controller import BlockScoutWeb.Controller
import ExplorerWeb.Router.Helpers import BlockScoutWeb.Router.Helpers
import ExplorerWeb.Gettext import BlockScoutWeb.Gettext
import ExplorerWeb.ErrorHelpers import BlockScoutWeb.ErrorHelpers
import Plug.Conn import Plug.Conn
end end
end end
@ -33,7 +33,7 @@ defmodule ExplorerWeb do
quote do quote do
use Phoenix.View, use Phoenix.View,
root: "lib/block_scout_web/templates", root: "lib/block_scout_web/templates",
namespace: ExplorerWeb namespace: BlockScoutWeb
# Import convenience functions from controllers # Import convenience functions from controllers
import Phoenix.Controller, only: [get_flash: 2, view_module: 1] import Phoenix.Controller, only: [get_flash: 2, view_module: 1]
@ -41,7 +41,7 @@ defmodule ExplorerWeb do
# Use all HTML functionality (forms, tags, etc) # Use all HTML functionality (forms, tags, etc)
use Phoenix.HTML use Phoenix.HTML
import ExplorerWeb.{ import BlockScoutWeb.{
CurrencyHelpers, CurrencyHelpers,
ErrorHelpers, ErrorHelpers,
Gettext, Gettext,
@ -65,7 +65,7 @@ defmodule ExplorerWeb do
quote do quote do
use Phoenix.Channel use Phoenix.Channel
import ExplorerWeb.Gettext import BlockScoutWeb.Gettext
end end
end end

@ -1,11 +1,11 @@
defmodule ExplorerWeb.Application do defmodule BlockScoutWeb.Application do
@moduledoc """ @moduledoc """
Supervises `ExplorerWeb.Endpoint` in order to serve Web UI. Supervises `BlockScoutWeb.Endpoint` in order to serve Web UI.
""" """
use Application use Application
alias ExplorerWeb.{Endpoint, EventHandler} alias BlockScoutWeb.{Endpoint, EventHandler}
def start(_type, _args) do def start(_type, _args) do
import Supervisor.Spec import Supervisor.Spec
@ -21,7 +21,7 @@ defmodule ExplorerWeb.Application do
# See https://hexdocs.pm/elixir/Supervisor.html # See https://hexdocs.pm/elixir/Supervisor.html
# for other strategies and supported options # for other strategies and supported options
opts = [strategy: :one_for_one, name: ExplorerWeb.Supervisor] opts = [strategy: :one_for_one, name: BlockScoutWeb.Supervisor]
Supervisor.start_link(children, opts) Supervisor.start_link(children, opts)
end end

@ -1,4 +1,4 @@
defmodule ExplorerWeb.Chain do defmodule BlockScoutWeb.Chain do
@moduledoc """ @moduledoc """
Converts the `param` to the corresponding resource that uses that format of param. Converts the `param` to the corresponding resource that uses that format of param.
""" """

@ -1,10 +1,10 @@
defmodule ExplorerWeb.AddressChannel do defmodule BlockScoutWeb.AddressChannel do
@moduledoc """ @moduledoc """
Establishes pub/sub channel for address page live updates. Establishes pub/sub channel for address page live updates.
""" """
use ExplorerWeb, :channel use BlockScoutWeb, :channel
alias ExplorerWeb.{AddressTransactionView, AddressView} alias BlockScoutWeb.{AddressTransactionView, AddressView}
alias Phoenix.View alias Phoenix.View
intercept(["balance_update", "count", "transaction"]) intercept(["balance_update", "count", "transaction"])
@ -18,7 +18,7 @@ defmodule ExplorerWeb.AddressChannel do
%{address: address, exchange_rate: exchange_rate}, %{address: address, exchange_rate: exchange_rate},
socket socket
) do ) do
Gettext.put_locale(ExplorerWeb.Gettext, socket.assigns.locale) Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale)
rendered = rendered =
View.render_to_string( View.render_to_string(
@ -34,7 +34,7 @@ defmodule ExplorerWeb.AddressChannel do
end end
def handle_out("count", %{count: count}, socket) do def handle_out("count", %{count: count}, socket) do
Gettext.put_locale(ExplorerWeb.Gettext, socket.assigns.locale) Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale)
push(socket, "count", %{count: Cldr.Number.to_string!(count, format: "#,###")}) push(socket, "count", %{count: Cldr.Number.to_string!(count, format: "#,###")})
@ -42,7 +42,7 @@ defmodule ExplorerWeb.AddressChannel do
end end
def handle_out("transaction", %{address: address, transaction: transaction}, socket) do def handle_out("transaction", %{address: address, transaction: transaction}, socket) do
Gettext.put_locale(ExplorerWeb.Gettext, socket.assigns.locale) Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale)
rendered = rendered =
View.render_to_string( View.render_to_string(

@ -1,10 +1,10 @@
defmodule ExplorerWeb.BlockChannel do defmodule BlockScoutWeb.BlockChannel do
@moduledoc """ @moduledoc """
Establishes pub/sub channel for live updates of block events. Establishes pub/sub channel for live updates of block events.
""" """
use ExplorerWeb, :channel use BlockScoutWeb, :channel
alias ExplorerWeb.{BlockView, ChainView} alias BlockScoutWeb.{BlockView, ChainView}
alias Phoenix.View alias Phoenix.View
intercept(["new_block"]) intercept(["new_block"])
@ -14,7 +14,7 @@ defmodule ExplorerWeb.BlockChannel do
end end
def handle_out("new_block", %{block: block, average_block_time: average_block_time}, socket) do def handle_out("new_block", %{block: block, average_block_time: average_block_time}, socket) do
Gettext.put_locale(ExplorerWeb.Gettext, socket.assigns.locale) Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale)
rendered_block = rendered_block =
View.render_to_string( View.render_to_string(

@ -1,10 +1,10 @@
defmodule ExplorerWeb.TransactionChannel do defmodule BlockScoutWeb.TransactionChannel do
@moduledoc """ @moduledoc """
Establishes pub/sub channel for live updates of transaction events. Establishes pub/sub channel for live updates of transaction events.
""" """
use ExplorerWeb, :channel use BlockScoutWeb, :channel
alias ExplorerWeb.TransactionView alias BlockScoutWeb.TransactionView
alias Phoenix.View alias Phoenix.View
intercept(["new_transaction"]) intercept(["new_transaction"])
@ -14,7 +14,7 @@ defmodule ExplorerWeb.TransactionChannel do
end end
def handle_out("new_transaction", %{transaction: transaction}, socket) do def handle_out("new_transaction", %{transaction: transaction}, socket) do
Gettext.put_locale(ExplorerWeb.Gettext, socket.assigns.locale) Gettext.put_locale(BlockScoutWeb.Gettext, socket.assigns.locale)
rendered_transaction = rendered_transaction =
View.render_to_string( View.render_to_string(

@ -1,9 +1,9 @@
defmodule ExplorerWeb.UserSocket do defmodule BlockScoutWeb.UserSocket do
use Phoenix.Socket use Phoenix.Socket
channel("addresses:*", ExplorerWeb.AddressChannel) channel("addresses:*", BlockScoutWeb.AddressChannel)
channel("blocks:*", ExplorerWeb.BlockChannel) channel("blocks:*", BlockScoutWeb.BlockChannel)
channel("transactions:*", ExplorerWeb.TransactionChannel) channel("transactions:*", BlockScoutWeb.TransactionChannel)
transport(:websocket, Phoenix.Transports.WebSocket, timeout: 45_000) transport(:websocket, Phoenix.Transports.WebSocket, timeout: 45_000)
# transport :longpoll, Phoenix.Transports.LongPoll # transport :longpoll, Phoenix.Transports.LongPoll

@ -1,4 +1,4 @@
defmodule ExplorerWeb.Controller do defmodule BlockScoutWeb.Controller do
@moduledoc """ @moduledoc """
Common controller error responses Common controller error responses
""" """
@ -12,14 +12,14 @@ defmodule ExplorerWeb.Controller do
def not_found(conn) do def not_found(conn) do
conn conn
|> put_status(:not_found) |> put_status(:not_found)
|> put_view(ExplorerWeb.ErrorView) |> put_view(BlockScoutWeb.ErrorView)
|> render("404.html") |> render("404.html")
end end
def unprocessable_entity(conn) do def unprocessable_entity(conn) do
conn conn
|> put_status(:unprocessable_entity) |> put_status(:unprocessable_entity)
|> put_view(ExplorerWeb.ErrorView) |> put_view(BlockScoutWeb.ErrorView)
|> render("422.html") |> render("422.html")
end end
end end

@ -1,7 +1,7 @@
defmodule ExplorerWeb.AddressContractController do defmodule BlockScoutWeb.AddressContractController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.AddressController, only: [transaction_count: 1] import BlockScoutWeb.AddressController, only: [transaction_count: 1]
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token

@ -1,5 +1,5 @@
defmodule ExplorerWeb.AddressContractVerificationController do defmodule BlockScoutWeb.AddressContractVerificationController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.Chain.SmartContract alias Explorer.Chain.SmartContract
alias Explorer.SmartContract.{Solidity.CompilerVersion, Publisher} alias Explorer.SmartContract.{Solidity.CompilerVersion, Publisher}

@ -1,5 +1,5 @@
defmodule ExplorerWeb.AddressController do defmodule BlockScoutWeb.AddressController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.Chain alias Explorer.Chain
alias Explorer.Chain.Address alias Explorer.Chain.Address

@ -1,12 +1,12 @@
defmodule ExplorerWeb.AddressInternalTransactionController do defmodule BlockScoutWeb.AddressInternalTransactionController do
@moduledoc """ @moduledoc """
Manages the displaying of information about internal transactions as they relate to addresses Manages the displaying of information about internal transactions as they relate to addresses
""" """
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.AddressController, only: [transaction_count: 1] import BlockScoutWeb.AddressController, only: [transaction_count: 1]
import ExplorerWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token

@ -1,11 +1,11 @@
defmodule ExplorerWeb.AddressReadContractController do defmodule BlockScoutWeb.AddressReadContractController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias Explorer.SmartContract.Reader alias Explorer.SmartContract.Reader
import ExplorerWeb.AddressController, only: [transaction_count: 1] import BlockScoutWeb.AddressController, only: [transaction_count: 1]
def index(conn, %{"address_id" => address_hash_string}) do def index(conn, %{"address_id" => address_hash_string}) do
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string),

@ -1,12 +1,12 @@
defmodule ExplorerWeb.AddressTransactionController do defmodule BlockScoutWeb.AddressTransactionController do
@moduledoc """ @moduledoc """
Display all the Transactions that terminate at this Address. Display all the Transactions that terminate at this Address.
""" """
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.AddressController, only: [transaction_count: 1] import BlockScoutWeb.AddressController, only: [transaction_count: 1]
import ExplorerWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token

@ -1,5 +1,5 @@
defmodule ExplorerWeb.API.RPC.AddressController do defmodule BlockScoutWeb.API.RPC.AddressController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.{Etherscan, Chain} alias Explorer.{Etherscan, Chain}
alias Explorer.Chain.{Address, Wei} alias Explorer.Chain.{Address, Wei}

@ -1,8 +1,8 @@
defmodule ExplorerWeb.API.RPC.BlockController do defmodule BlockScoutWeb.API.RPC.BlockController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.Chain alias Explorer.Chain
alias ExplorerWeb.Chain, as: ChainWeb alias BlockScoutWeb.Chain, as: ChainWeb
def getblockreward(conn, params) do def getblockreward(conn, params) do
with {:block_param, {:ok, unsafe_block_number}} <- {:block_param, Map.fetch(params, "blockno")}, with {:block_param, {:ok, unsafe_block_number}} <- {:block_param, Map.fetch(params, "blockno")},

@ -1,4 +1,4 @@
defmodule ExplorerWeb.API.RPC.RPCTranslator do defmodule BlockScoutWeb.API.RPC.RPCTranslator do
@moduledoc """ @moduledoc """
Converts an RPC-style request into a controller action. Converts an RPC-style request into a controller action.
@ -15,7 +15,7 @@ defmodule ExplorerWeb.API.RPC.RPCTranslator do
import Plug.Conn import Plug.Conn
alias ExplorerWeb.API.RPC.RPCView alias BlockScoutWeb.API.RPC.RPCView
alias Plug.Conn alias Plug.Conn
alias Phoenix.Controller alias Phoenix.Controller

@ -1,5 +1,5 @@
defmodule ExplorerWeb.API.V1.SupplyController do defmodule BlockScoutWeb.API.V1.SupplyController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.Chain alias Explorer.Chain

@ -1,7 +1,7 @@
defmodule ExplorerWeb.APIDocsController do defmodule BlockScoutWeb.APIDocsController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias ExplorerWeb.Etherscan alias BlockScoutWeb.Etherscan
def index(conn, _params) do def index(conn, _params) do
conn conn

@ -1,7 +1,7 @@
defmodule ExplorerWeb.BlockController do defmodule BlockScoutWeb.BlockController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.Chain alias Explorer.Chain

@ -1,7 +1,7 @@
defmodule ExplorerWeb.BlockTransactionController do defmodule BlockScoutWeb.BlockTransactionController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.Chain, import BlockScoutWeb.Chain,
only: [paging_options: 1, param_to_block_number: 1, next_page_params: 3, split_list_by_page: 1] only: [paging_options: 1, param_to_block_number: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.Chain alias Explorer.Chain

@ -1,5 +1,5 @@
defmodule ExplorerWeb.ChainController do defmodule BlockScoutWeb.ChainController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.{Chain, PagingOptions, Repo} alias Explorer.{Chain, PagingOptions, Repo}
alias Explorer.Chain.{Address, Block, Transaction} alias Explorer.Chain.{Address, Block, Transaction}
@ -42,7 +42,7 @@ defmodule ExplorerWeb.ChainController do
def search(conn, %{"q" => query}) do def search(conn, %{"q" => query}) do
query query
|> String.trim() |> String.trim()
|> ExplorerWeb.Chain.from_param() |> BlockScoutWeb.Chain.from_param()
|> case do |> case do
{:ok, item} -> {:ok, item} ->
redirect_search_results(conn, item) redirect_search_results(conn, item)

@ -1,7 +1,7 @@
defmodule ExplorerWeb.PendingTransactionController do defmodule BlockScoutWeb.PendingTransactionController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.Chain alias Explorer.Chain

@ -1,9 +1,9 @@
defmodule ExplorerWeb.TokenController do defmodule BlockScoutWeb.TokenController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
alias Explorer.Chain alias Explorer.Chain
import ExplorerWeb.Chain, only: [split_list_by_page: 1, paging_options: 1, next_page_params: 3] import BlockScoutWeb.Chain, only: [split_list_by_page: 1, paging_options: 1, next_page_params: 3]
def show(conn, %{"id" => address_hash_string} = params) do def show(conn, %{"id" => address_hash_string} = params) do
with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string), with {:ok, address_hash} <- Chain.string_to_address_hash(address_hash_string),

@ -1,7 +1,7 @@
defmodule ExplorerWeb.TransactionController do defmodule BlockScoutWeb.TransactionController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.Chain alias Explorer.Chain

@ -1,7 +1,7 @@
defmodule ExplorerWeb.TransactionInternalTransactionController do defmodule BlockScoutWeb.TransactionInternalTransactionController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token

@ -1,7 +1,7 @@
defmodule ExplorerWeb.TransactionLogController do defmodule BlockScoutWeb.TransactionLogController do
use ExplorerWeb, :controller use BlockScoutWeb, :controller
import ExplorerWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1] import BlockScoutWeb.Chain, only: [paging_options: 1, next_page_params: 3, split_list_by_page: 1]
alias Explorer.{Chain, Market} alias Explorer.{Chain, Market}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token

@ -1,4 +1,4 @@
defmodule ExplorerWeb.CSPHeader do defmodule BlockScoutWeb.CSPHeader do
@moduledoc """ @moduledoc """
Plug to set content-security-policy with websocket endpoints Plug to set content-security-policy with websocket endpoints
""" """

@ -1,11 +1,11 @@
defmodule ExplorerWeb.Endpoint do defmodule BlockScoutWeb.Endpoint do
use Phoenix.Endpoint, otp_app: :block_scout_web use Phoenix.Endpoint, otp_app: :block_scout_web
if Application.get_env(:block_scout_web, :sql_sandbox) do if Application.get_env(:block_scout_web, :sql_sandbox) do
plug(Phoenix.Ecto.SQL.Sandbox, repo: Explorer.Repo) plug(Phoenix.Ecto.SQL.Sandbox, repo: Explorer.Repo)
end end
socket("/socket", ExplorerWeb.UserSocket) socket("/socket", BlockScoutWeb.UserSocket)
# Serve at "/" the static files from "priv/static" directory. # Serve at "/" the static files from "priv/static" directory.
# #
@ -50,7 +50,7 @@ defmodule ExplorerWeb.Endpoint do
signing_salt: "iC2ksJHS" signing_salt: "iC2ksJHS"
) )
plug(ExplorerWeb.Router) plug(BlockScoutWeb.Router)
def init(_key, config) do def init(_key, config) do
if config[:load_from_system_env] do if config[:load_from_system_env] do

@ -1,4 +1,4 @@
defmodule ExplorerWeb.Etherscan do defmodule BlockScoutWeb.Etherscan do
@moduledoc """ @moduledoc """
Documentation data for Etherscan-compatible API. Documentation data for Etherscan-compatible API.
""" """

@ -1,11 +1,11 @@
defmodule ExplorerWeb.EventHandler do defmodule BlockScoutWeb.EventHandler do
@moduledoc """ @moduledoc """
Subscribing process for broadcast events from Chain context. Subscribing process for broadcast events from Chain context.
""" """
use GenServer use GenServer
alias Explorer.Chain alias Explorer.Chain
alias ExplorerWeb.Notifier alias BlockScoutWeb.Notifier
# Client # Client

@ -1,4 +1,4 @@
defmodule ExplorerWeb.ExchangeRates.USD do defmodule BlockScoutWeb.ExchangeRates.USD do
@moduledoc """ @moduledoc """
Struct and associated conversion functions for USD currency Struct and associated conversion functions for USD currency
""" """

@ -1,11 +1,11 @@
defmodule ExplorerWeb.Gettext do defmodule BlockScoutWeb.Gettext do
@moduledoc """ @moduledoc """
A module providing Internationalization with a gettext-based API. A module providing Internationalization with a gettext-based API.
By using [Gettext](https://hexdocs.pm/gettext), By using [Gettext](https://hexdocs.pm/gettext),
your module gains a set of macros for translations, for example: your module gains a set of macros for translations, for example:
import ExplorerWeb.Gettext import BlockScoutWeb.Gettext
# Simple translation # Simple translation
gettext "Here is the string to translate" gettext "Here is the string to translate"

@ -1,4 +1,4 @@
defmodule ExplorerWeb.Notifier do defmodule BlockScoutWeb.Notifier do
@moduledoc """ @moduledoc """
Responds to events from EventHandler by sending appropriate channel updates to front-end. Responds to events from EventHandler by sending appropriate channel updates to front-end.
""" """
@ -6,7 +6,7 @@ defmodule ExplorerWeb.Notifier do
alias Explorer.{Chain, Market, Repo} alias Explorer.{Chain, Market, Repo}
alias Explorer.Chain.Address alias Explorer.Chain.Address
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias ExplorerWeb.Endpoint alias BlockScoutWeb.Endpoint
def handle_event({:chain_event, :addresses, addresses}) do def handle_event({:chain_event, :addresses, addresses}) do
address_count_module = Application.get_env(:block_scout_web, :fake_adapter) || Chain address_count_module = Application.get_env(:block_scout_web, :fake_adapter) || Chain

@ -1,12 +1,12 @@
defmodule ExplorerWeb.Router do defmodule BlockScoutWeb.Router do
use ExplorerWeb, :router use BlockScoutWeb, :router
pipeline :browser do pipeline :browser do
plug(:accepts, ["html"]) plug(:accepts, ["html"])
plug(:fetch_session) plug(:fetch_session)
plug(:fetch_flash) plug(:fetch_flash)
plug(:protect_from_forgery) plug(:protect_from_forgery)
plug(ExplorerWeb.CSPHeader) plug(BlockScoutWeb.CSPHeader)
end end
pipeline :api do pipeline :api do
@ -14,19 +14,19 @@ defmodule ExplorerWeb.Router do
end end
pipeline :set_locale do pipeline :set_locale do
plug(SetLocale, gettext: ExplorerWeb.Gettext, default_locale: "en") plug(SetLocale, gettext: BlockScoutWeb.Gettext, default_locale: "en")
end end
scope "/api/v1", ExplorerWeb.API.V1, as: :api_v1 do scope "/api/v1", BlockScoutWeb.API.V1, as: :api_v1 do
pipe_through(:api) pipe_through(:api)
get("/supply", SupplyController, :supply) get("/supply", SupplyController, :supply)
end end
scope "/api", ExplorerWeb.API.RPC do scope "/api", BlockScoutWeb.API.RPC do
pipe_through(:api) pipe_through(:api)
alias ExplorerWeb.API.RPC alias BlockScoutWeb.API.RPC
forward("/", RPCTranslator, %{ forward("/", RPCTranslator, %{
"block" => RPC.BlockController, "block" => RPC.BlockController,
@ -34,13 +34,13 @@ defmodule ExplorerWeb.Router do
}) })
end end
scope "/", ExplorerWeb do scope "/", BlockScoutWeb do
pipe_through(:browser) pipe_through(:browser)
pipe_through(:set_locale) pipe_through(:set_locale)
resources("/", ChainController, only: [:show], singleton: true, as: :chain) resources("/", ChainController, only: [:show], singleton: true, as: :chain)
end end
scope "/:locale", ExplorerWeb do scope "/:locale", BlockScoutWeb do
pipe_through(:browser) pipe_through(:browser)
pipe_through(:set_locale) pipe_through(:set_locale)
resources("/", ChainController, only: [:show], singleton: true, as: :chain) resources("/", ChainController, only: [:show], singleton: true, as: :chain)

@ -1,4 +1,4 @@
defmodule ExplorerWeb.SocialMedia do defmodule BlockScoutWeb.SocialMedia do
@moduledoc """ @moduledoc """
This module provides social media links This module provides social media links
""" """

@ -1,5 +1,5 @@
<%= if @address_hash do %> <%= if @address_hash do %>
<%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @address_hash), "data-address-hash": @address_hash, "data-test": "address_hash_link" do %> <%= link to: address_path(BlockScoutWeb.Endpoint, :show, @locale, @address_hash), "data-address-hash": @address_hash, "data-test": "address_hash_link" do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @address_hash, contract: @contract %> <%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address_hash: @address_hash, contract: @contract %>
<% end %> <% end %>
<% end %> <% end %>

@ -1,4 +1,4 @@
<span class="<%= if @contract do %>contract-address<% end %>"> <span class="<%= if @contract do %>contract-address<% end %>">
<span class="d-none d-md-none d-lg-inline"><%= @address_hash %></span> <span class="d-none d-md-none d-lg-inline"><%= @address_hash %></span>
<span class="d-md-inline-block d-lg-none "><%= ExplorerWeb.AddressView.trimmed_hash(@address_hash) %></span> <span class="d-md-inline-block d-lg-none "><%= BlockScoutWeb.AddressView.trimmed_hash(@address_hash) %></span>
</span> </span>

@ -16,7 +16,7 @@
</span> </span>
</div> </div>
<h1 class="card-title"><%= address_title(@address) %> Details </h1> <h1 class="card-title"><%= address_title(@address) %> Details </h1>
<h3 class="<%= if ExplorerWeb.AddressView.contract?(@address) do %>contract-address<% end %>" data-test="address_detail_hash"><%= @address %></h3> <h3 class="<%= if BlockScoutWeb.AddressView.contract?(@address) do %>contract-address<% end %>" data-test="address_detail_hash"><%= @address %></h3>
<div class="d-flex flex-row justify-content-start text-muted"> <div class="d-flex flex-row justify-content-start text-muted">
<span class="mr-4"><span data-selector="transaction-count"><%= Cldr.Number.to_string!(@transaction_count, format: "#,###") %></span> <%= gettext "Transactions" %></span> <span class="mr-4"><span data-selector="transaction-count"><%= Cldr.Number.to_string!(@transaction_count, format: "#,###") %></span> <%= gettext "Transactions" %></span>
@ -26,7 +26,7 @@
<%= link( <%= link(
trimmed_hash(@address.contracts_creation_internal_transaction.from_address_hash), trimmed_hash(@address.contracts_creation_internal_transaction.from_address_hash),
to: address_path( to: address_path(
ExplorerWeb.Endpoint, BlockScoutWeb.Endpoint,
:show, :show,
@locale, @locale,
@address.contracts_creation_internal_transaction.from_address_hash @address.contracts_creation_internal_transaction.from_address_hash
@ -38,7 +38,7 @@
<%= link( <%= link(
trimmed_hash(@address.contracts_creation_internal_transaction.transaction_hash), trimmed_hash(@address.contracts_creation_internal_transaction.transaction_hash),
to: transaction_path( to: transaction_path(
ExplorerWeb.Endpoint, BlockScoutWeb.Endpoint,
:show, :show,
@locale, @locale,
@address.contracts_creation_internal_transaction.transaction_hash @address.contracts_creation_internal_transaction.transaction_hash
@ -52,7 +52,7 @@
</div> </div>
</div> </div>
<div class="col-md-6 col-lg-4" data-selector="balance-card"> <div class="col-md-6 col-lg-4" data-selector="balance-card">
<%= render ExplorerWeb.AddressView, "_balance_card.html", address: @address, exchange_rate: @exchange_rate %> <%= render BlockScoutWeb.AddressView, "_balance_card.html", address: @address, exchange_rate: @exchange_rate %>
</div> </div>
</div> </div>
</section> </section>

@ -1,6 +1,6 @@
<section class="container"> <section class="container">
<%= render ExplorerWeb.AddressView, "overview.html", assigns %> <%= render BlockScoutWeb.AddressView, "overview.html", assigns %>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">

@ -4,22 +4,22 @@
<%= gettext("Internal Transaction") %> <%= gettext("Internal Transaction") %>
</div> </div>
<div class="col-md-8 col-lg-8 d-flex flex-column text-nowrap pr-2 pr-sm-2 pr-md-0"> <div class="col-md-8 col-lg-8 d-flex flex-column text-nowrap pr-2 pr-sm-2 pr-md-0">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @internal_transaction.transaction_hash %> <%= render BlockScoutWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @internal_transaction.transaction_hash %>
<span class="text-nowrap"> <span class="text-nowrap">
<%= if @address.hash == @internal_transaction.from_address_hash do %> <%= if @address.hash == @internal_transaction.from_address_hash do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.from_address) %> <%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address_hash: @internal_transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(@internal_transaction.from_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.from_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: @internal_transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(@internal_transaction.from_address), locale: @locale %>
<% end %> <% end %>
&rarr; &rarr;
<%= if @address.hash == ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction) do %> <%= if @address.hash == BlockScoutWeb.InternalTransactionView.to_address_hash(@internal_transaction) do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: ExplorerWeb.AddressView.contract?(@internal_transaction.to_address) %> <%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address_hash: BlockScoutWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: BlockScoutWeb.AddressView.contract?(@internal_transaction.to_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: ExplorerWeb.AddressView.contract?(@internal_transaction.to_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: BlockScoutWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: BlockScoutWeb.AddressView.contract?(@internal_transaction.to_address), locale: @locale %>
<% end %> <% end %>
</span> </span>
<span class="tile-title text-truncate mt-3 mt-md-0"> <span class="tile-title text-truncate mt-3 mt-md-0">
<%= ExplorerWeb.TransactionView.value(@internal_transaction, include_label: false) %> <%= gettext "Ether" %> <%= BlockScoutWeb.TransactionView.value(@internal_transaction, include_label: false) %> <%= gettext "Ether" %>
</span> </span>
</div> </div>
<div class="col-md-2 d-flex flex-row flex-md-column justify-content-start align-items-end mt-3 mt-md-0"> <div class="col-md-2 d-flex flex-row flex-md-column justify-content-start align-items-end mt-3 mt-md-0">

@ -1,6 +1,6 @@
<section class="container"> <section class="container">
<%= render ExplorerWeb.AddressView, "overview.html", assigns %> <%= render BlockScoutWeb.AddressView, "overview.html", assigns %>
<section> <section>
<div class="card"> <div class="card">

@ -1,6 +1,6 @@
<section class="container"> <section class="container">
<%= render ExplorerWeb.AddressView, "overview.html", assigns %> <%= render BlockScoutWeb.AddressView, "overview.html", assigns %>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">

@ -1,37 +1,37 @@
<div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %> fade-in tile-status--<%= ExplorerWeb.TransactionView.status(@transaction) %>" data-transaction-hash="<%= @transaction.hash %>"> <div class="tile tile-type-<%= BlockScoutWeb.TransactionView.type_suffix(@transaction) %> fade-in tile-status--<%= BlockScoutWeb.TransactionView.status(@transaction) %>" data-transaction-hash="<%= @transaction.hash %>">
<div class="row"> <div class="row">
<div class="col-md-2 d-flex flex-row flex-md-column align-items-left justify-content-start justify-content-lg-center mb-1 mb-md-0 pl-md-4"> <div class="col-md-2 d-flex flex-row flex-md-column align-items-left justify-content-start justify-content-lg-center mb-1 mb-md-0 pl-md-4">
<span class="tile-label"> <span class="tile-label">
<%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %> <%= BlockScoutWeb.TransactionView.transaction_display_type(@transaction) %>
</span> </span>
<span class="tile-status-label ml-2 ml-md-0" data-test="transaction_status"> <span class="tile-status-label ml-2 ml-md-0" data-test="transaction_status">
<%= ExplorerWeb.TransactionView.formatted_status(@transaction) %> <%= BlockScoutWeb.TransactionView.formatted_status(@transaction) %>
</span> </span>
</div> </div>
<div class="col-md-7 col-lg-8 d-flex flex-column pr-2 pr-sm-2 pr-md-0"> <div class="col-md-7 col-lg-8 d-flex flex-column pr-2 pr-sm-2 pr-md-0">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %> <%= render BlockScoutWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %>
<span class="text-nowrap"> <span class="text-nowrap">
<%= if @address.hash == @transaction.from_address_hash do %> <%= if @address.hash == @transaction.from_address_hash do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address) %> <%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address_hash: @transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(@transaction.from_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(@transaction.from_address), locale: @locale %>
<% end %> <% end %>
&rarr; &rarr;
<%= if @address.hash == ExplorerWeb.TransactionView.to_address_hash(@transaction) do %> <%= if @address.hash == BlockScoutWeb.TransactionView.to_address_hash(@transaction) do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address) %> <%= render BlockScoutWeb.AddressView, "_responsive_hash.html", address_hash: BlockScoutWeb.TransactionView.to_address_hash(@transaction), contract: BlockScoutWeb.AddressView.contract?(@transaction.to_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: BlockScoutWeb.TransactionView.to_address_hash(@transaction), contract: BlockScoutWeb.AddressView.contract?(@transaction.to_address), locale: @locale %>
<% end %> <% end %>
</span> </span>
<span class="d-flex flex-md-row flex-column mt-3 mt-md-0"> <span class="d-flex flex-md-row flex-column mt-3 mt-md-0">
<span class="tile-title"> <span class="tile-title">
<%= ExplorerWeb.TransactionView.value(@transaction, include_label: false) %> <%= gettext "Ether" %> <%= BlockScoutWeb.TransactionView.value(@transaction, include_label: false) %> <%= gettext "Ether" %>
</span> </span>
<span class="ml-0 ml-md-1 text-nowrap"> <span class="ml-0 ml-md-1 text-nowrap">
<%= ExplorerWeb.TransactionView.formatted_fee(@transaction, denomination: :ether, include_label: false) %> <%= gettext "TX Fee" %> <%= BlockScoutWeb.TransactionView.formatted_fee(@transaction, denomination: :ether, include_label: false) %> <%= gettext "TX Fee" %>
</span> </span>
</span> </span>
</div> </div>
@ -39,7 +39,7 @@
<span class="mr-2 mr-md-0 order-1"> <span class="mr-2 mr-md-0 order-1">
<%= link( <%= link(
gettext("Block #%{number}", number: to_string(@transaction.block.number)), gettext("Block #%{number}", number: to_string(@transaction.block.number)),
to: block_path(ExplorerWeb.Endpoint, :show, @locale, @transaction.block) to: block_path(BlockScoutWeb.Endpoint, :show, @locale, @transaction.block)
) %> ) %>
</span> </span>
<span class="mr-2 mr-md-0 order-2" data-from-now="<%= @transaction.block.timestamp %>"></span> <span class="mr-2 mr-md-0 order-2" data-from-now="<%= @transaction.block.timestamp %>"></span>
@ -58,7 +58,7 @@
<% end %> <% end %>
</div> </div>
<%= if ExplorerWeb.TransactionView.involves_token_transfers?(@transaction) do %> <%= if BlockScoutWeb.TransactionView.involves_token_transfers?(@transaction) do %>
<div class="offset-md-2 col-md-10"> <div class="offset-md-2 col-md-10">
<hr class="mt-3 mb-3 w-100" /> <hr class="mt-3 mb-3 w-100" />
<p class="tile-title"><%= gettext "Transfers" %></p> <p class="tile-title"><%= gettext "Transfers" %></p>
@ -69,11 +69,11 @@
<div class="offset-md-2 col-md-7 col-lg-8 d-flex flex-column mt-1 mb-2"> <div class="offset-md-2 col-md-7 col-lg-8 d-flex flex-column mt-1 mb-2">
<span class="text-nowrap" data-test="token_transfer"> <span class="text-nowrap" data-test="token_transfer">
<span data-test="token_transfer_address_hash"> <span data-test="token_transfer_address_hash">
<%= ExplorerWeb.AddressView.display_address_hash(@address, token_transfer.from_address, @locale) %> <%= BlockScoutWeb.AddressView.display_address_hash(@address, token_transfer.from_address, @locale) %>
</span> </span>
&rarr; &rarr;
<span data-test="token_transfer_address_hash"> <span data-test="token_transfer_address_hash">
<%= ExplorerWeb.AddressView.display_address_hash(@address, token_transfer.to_address, @locale) %> <%= BlockScoutWeb.AddressView.display_address_hash(@address, token_transfer.to_address, @locale) %>
</span> </span>
</span> </span>
<span class="tile-title"> <span class="tile-title">

@ -1,6 +1,6 @@
<section class="container"> <section class="container">
<%= render ExplorerWeb.AddressView, "overview.html", assigns %> <%= render BlockScoutWeb.AddressView, "overview.html", assigns %>
<section> <section>
<div class="card"> <div class="card">

@ -3,7 +3,7 @@
<div class="card-body"> <div class="card-body">
<h1 class="card-title mb-0">API Documentation</h2> <h1 class="card-title mb-0">API Documentation</h2>
<small class="text-monospace text-secondary" data-endpoint-url="<%= ExplorerWeb.Endpoint.url() %>/api">[ Base URL: <%= @conn.host %>/api ]</small> <small class="text-monospace text-secondary" data-endpoint-url="<%= BlockScoutWeb.Endpoint.url() %>/api">[ Base URL: <%= @conn.host %>/api ]</small>
<p class="mt-4">This API is provided for developers transitioning their applications from Etherscan to Explorer. It supports GET and POST requests.</p> <p class="mt-4">This API is provided for developers transitioning their applications from Etherscan to Explorer. It supports GET and POST requests.</p>
</div> </div>

@ -5,7 +5,7 @@
<%= link( <%= link(
@block, @block,
class: "tile-title", class: "tile-title",
to: block_path(ExplorerWeb.Endpoint, :show, @locale, @block), to: block_path(BlockScoutWeb.Endpoint, :show, @locale, @block),
"data-test": "block_number", "data-test": "block_number",
"data-block-number": to_string(@block.number) "data-block-number": to_string(@block.number)
) %> ) %>
@ -23,7 +23,7 @@
<!-- validator --> <!-- validator -->
<%= gettext "Miner" %> <%= gettext "Miner" %>
<span class="ml-2"> <span class="ml-2">
<%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @block.miner_hash) do %> <%= link to: address_path(BlockScoutWeb.Endpoint, :show, @locale, @block.miner_hash) do %>
<%= @block.miner_hash %> <%= @block.miner_hash %>
<% end %> <% end %>
</span> </span>

@ -6,7 +6,7 @@
<span data-selector="blocks-list"> <span data-selector="blocks-list">
<%= for block <- @blocks do %> <%= for block <- @blocks do %>
<%= render ExplorerWeb.BlockView, "_tile.html", locale: @locale, block: block %> <%= render BlockScoutWeb.BlockView, "_tile.html", locale: @locale, block: block %>
<% end %> <% end %>
</span> </span>

@ -73,7 +73,7 @@
<div class="text-right"> <div class="text-right">
<!-- Validator's Name --> <!-- Validator's Name -->
<!-- Until we can get the validator's name we are using the Validator's address hash --> <!-- Until we can get the validator's name we are using the Validator's address hash -->
<h3 class="text-white text-truncate"> <%= link @block.miner, class: "text-white", to: address_path(ExplorerWeb.Endpoint, :show, @locale, @block.miner) %> </h3> <h3 class="text-white text-truncate"> <%= link @block.miner, class: "text-white", to: address_path(BlockScoutWeb.Endpoint, :show, @locale, @block.miner) %> </h3>
<!-- Validator's address hash --> <!-- Validator's address hash -->
<span class="text-light text-truncate"> </span> <span class="text-light text-truncate"> </span>
</div> </div>

@ -1,6 +1,6 @@
<section class="container"> <section class="container">
<%= render ExplorerWeb.BlockView, "overview.html", assigns %> <%= render BlockScoutWeb.BlockView, "overview.html", assigns %>
<section> <section>
<div class="card mb-3"> <div class="card mb-3">
@ -36,7 +36,7 @@
<h2 class="card-title"><%= gettext "Transactions" %></h2> <h2 class="card-title"><%= gettext "Transactions" %></h2>
<span data-selector="transactions-list"> <span data-selector="transactions-list">
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<%= render ExplorerWeb.TransactionView, "_tile.html", locale: @locale, transaction: transaction %> <%= render BlockScoutWeb.TransactionView, "_tile.html", locale: @locale, transaction: transaction %>
<% end %> <% end %>
</span> </span>
<% else %> <% else %>

@ -1,13 +1,13 @@
<div class="col-sm-3 fade-up-blocks-chain mb-3 mb-sm-0" data-selector="chain-block" data-block-number="<%= @block.number %>"> <div class="col-sm-3 fade-up-blocks-chain mb-3 mb-sm-0" data-selector="chain-block" data-block-number="<%= @block.number %>">
<div class="tile d-flex flex-column"> <div class="tile d-flex flex-column">
<%= link(@block, to: block_path(ExplorerWeb.Endpoint, :show, @locale, @block), class: "tile-title") %> <%= link(@block, to: block_path(BlockScoutWeb.Endpoint, :show, @locale, @block), class: "tile-title") %>
<div> <div>
<%= Enum.count(@block.transactions) %> Transactions <%= Enum.count(@block.transactions) %> Transactions
<span class="ml-2" data-from-now="<%= @block.timestamp %>"> </span> <span class="ml-2" data-from-now="<%= @block.timestamp %>"> </span>
</div> </div>
<span class="text-truncate"> <span class="text-truncate">
<%= gettext "Miner" %> <%= gettext "Miner" %>
<%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @block.miner), <%= link to: address_path(BlockScoutWeb.Endpoint, :show, @locale, @block.miner),
"data-toggle": "tooltip", "data-toggle": "tooltip",
"data-placement": "top", "data-placement": "top",
title: @block.miner do %> title: @block.miner do %>

@ -54,11 +54,11 @@
<section class="container"> <section class="container">
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-body">
<%= link(gettext("View All Blocks →"), to: block_path(ExplorerWeb.Endpoint, :index, Gettext.get_locale), class: "button button--secondary button--xsmall float-right") %> <%= link(gettext("View All Blocks →"), to: block_path(BlockScoutWeb.Endpoint, :index, Gettext.get_locale), class: "button button--secondary button--xsmall float-right") %>
<h2 class="card-title"><%= gettext "Blocks" %></h2> <h2 class="card-title"><%= gettext "Blocks" %></h2>
<div class="row" data-selector="chain-block-list"> <div class="row" data-selector="chain-block-list">
<%= for block <- @blocks do %> <%= for block <- @blocks do %>
<%= render ExplorerWeb.ChainView, "_block.html", locale: @locale, block: block %> <%= render BlockScoutWeb.ChainView, "_block.html", locale: @locale, block: block %>
<% end %> <% end %>
</div> </div>
</div> </div>
@ -71,11 +71,11 @@
<a href="#" class="alert-link"><span data-selector="channel-batching-count"></span> <%= gettext "More transactions have come in" %></a> <a href="#" class="alert-link"><span data-selector="channel-batching-count"></span> <%= gettext "More transactions have come in" %></a>
</div> </div>
</div> </div>
<%= link(gettext("View All Transactions →"), to: transaction_path(ExplorerWeb.Endpoint, :index, Gettext.get_locale), class: "button button--secondary button--xsmall float-right") %> <%= link(gettext("View All Transactions →"), to: transaction_path(BlockScoutWeb.Endpoint, :index, Gettext.get_locale), class: "button button--secondary button--xsmall float-right") %>
<h2 class="card-title"><%= gettext "Transactions" %></h2> <h2 class="card-title"><%= gettext "Transactions" %></h2>
<span data-selector="transactions-list"> <span data-selector="transactions-list">
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<%= render ExplorerWeb.TransactionView, "_tile.html", locale: @locale, transaction: transaction %> <%= render BlockScoutWeb.TransactionView, "_tile.html", locale: @locale, transaction: transaction %>
<% end %> <% end %>
</span> </span>
</div> </div>

@ -10,13 +10,13 @@
<body> <body>
<div class="layout-container"> <div class="layout-container">
<%= render ExplorerWeb.LayoutView, "_topnav.html", assigns %> <%= render BlockScoutWeb.LayoutView, "_topnav.html", assigns %>
<main class="pt-5"> <main class="pt-5">
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p> <p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p>
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p> <p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p>
<%= render @view_module, @view_template, assigns %> <%= render @view_module, @view_template, assigns %>
</main> </main>
<%= render ExplorerWeb.LayoutView, "_footer.html", assigns %> <%= render BlockScoutWeb.LayoutView, "_footer.html", assigns %>
</div> </div>
<script src="<%= static_path(@conn, "/js/app.js") %>"></script> <script src="<%= static_path(@conn, "/js/app.js") %>"></script>
</body> </body>

@ -47,26 +47,26 @@
<p><%= gettext("Showing %{count} Pending Transactions", count: @pending_transaction_count) %></p> <p><%= gettext("Showing %{count} Pending Transactions", count: @pending_transaction_count) %></p>
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-test="<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-transaction-hash="<%= transaction.hash %>"> <div class="tile tile-type-<%= BlockScoutWeb.TransactionView.type_suffix(transaction) %>" data-test="<%= BlockScoutWeb.TransactionView.type_suffix(transaction) %>" data-transaction-hash="<%= transaction.hash %>">
<div class="row" data-test="chain_transaction"> <div class="row" data-test="chain_transaction">
<div class="col-md-2 d-flex flex-row flex-md-column align-items-left justify-content-start justify-content-lg-center mb-1 mb-md-0 pl-md-4"> <div class="col-md-2 d-flex flex-row flex-md-column align-items-left justify-content-start justify-content-lg-center mb-1 mb-md-0 pl-md-4">
<span class="tile-label" data-test="transaction_type"> <%= ExplorerWeb.TransactionView.transaction_display_type(transaction) %></span> <span class="tile-label" data-test="transaction_type"> <%= BlockScoutWeb.TransactionView.transaction_display_type(transaction) %></span>
<div class="tile-status-label ml-2 ml-md-0" data-test="transaction_status"><%= ExplorerWeb.TransactionView.formatted_status(transaction) %></div> <div class="tile-status-label ml-2 ml-md-0" data-test="transaction_status"><%= BlockScoutWeb.TransactionView.formatted_status(transaction) %></div>
</div> </div>
<div class="col-md-7 col-lg-8 d-flex flex-column pr-2 pr-sm-2 pr-md-0"> <div class="col-md-7 col-lg-8 d-flex flex-column pr-2 pr-sm-2 pr-md-0">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %> <%= render BlockScoutWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %>
<span class="text-nowrap"> <span class="text-nowrap">
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(transaction.from_address), locale: @locale %>
&rarr; &rarr;
<%= if transaction.to_address_hash do %> <%= if transaction.to_address_hash do %>
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.to_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: transaction.to_address_hash, contract: BlockScoutWeb.AddressView.contract?(transaction.to_address), locale: @locale %>
<% else %> <% else %>
<%= gettext("Contract Address Pending") %> <%= gettext("Contract Address Pending") %>
<% end %> <% end %>
</span> </span>
<span class="d-flex flex-md-row flex-column mt-3 mt-md-0"> <span class="d-flex flex-md-row flex-column mt-3 mt-md-0">
<span class="tile-title"><%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> <%= gettext "Ether" %></span> <span class="tile-title"><%= BlockScoutWeb.TransactionView.value(transaction, include_label: false) %> <%= gettext "Ether" %></span>
<span class="ml-0 ml-md-1 text-nowrap"> <%= ExplorerWeb.TransactionView.formatted_fee(transaction, denomination: :ether, include_label: false) %> <%= gettext "TX Fee" %></span> <span class="ml-0 ml-md-1 text-nowrap"> <%= BlockScoutWeb.TransactionView.formatted_fee(transaction, denomination: :ether, include_label: false) %> <%= gettext "TX Fee" %></span>
</span> </span>
</div> </div>

@ -6,21 +6,21 @@
<div class="col-md-7 col-lg-8 d-flex flex-column"> <div class="col-md-7 col-lg-8 d-flex flex-column">
<p class="tile-title text-truncate"> <p class="tile-title text-truncate">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transfer.transaction_hash %> <%= render BlockScoutWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transfer.transaction_hash %>
</p> </p>
<span> <span>
<%= render ExplorerWeb.AddressView, <%= render BlockScoutWeb.AddressView,
"_link.html", "_link.html",
address_hash: to_string(@transfer.from_address_hash), address_hash: to_string(@transfer.from_address_hash),
contract: ExplorerWeb.AddressView.contract?(@transfer.from_address), contract: BlockScoutWeb.AddressView.contract?(@transfer.from_address),
locale: @locale %> locale: @locale %>
&rarr; &rarr;
<%= render ExplorerWeb.AddressView, <%= render BlockScoutWeb.AddressView,
"_link.html", "_link.html",
address_hash: to_string(@transfer.to_address_hash), address_hash: to_string(@transfer.to_address_hash),
contract: ExplorerWeb.AddressView.contract?(@transfer.to_address), contract: BlockScoutWeb.AddressView.contract?(@transfer.to_address),
locale: @locale %> locale: @locale %>
</span> </span>
@ -40,7 +40,7 @@
number: @transfer.transaction.block_number number: @transfer.transaction.block_number
), ),
class: "mr-2 mr-sm-0 text-muted", class: "mr-2 mr-sm-0 text-muted",
to: block_path(ExplorerWeb.Endpoint, :show, @locale, @transfer.transaction.block_number) to: block_path(BlockScoutWeb.Endpoint, :show, @locale, @transfer.transaction.block_number)
) %> ) %>
</span> </span>
</div> </div>

@ -1,4 +1,4 @@
<%= link(@transaction_hash, <%= link(@transaction_hash,
to: transaction_path(ExplorerWeb.Endpoint, :show, @locale, @transaction_hash), to: transaction_path(BlockScoutWeb.Endpoint, :show, @locale, @transaction_hash),
"data-test": "transaction_hash_link", "data-test": "transaction_hash_link",
class: "text-truncate") %> class: "text-truncate") %>

@ -1,32 +1,32 @@
<div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %> tile-status--<%= ExplorerWeb.TransactionView.status(@transaction) %> fade-up" data-test="<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %>" data-transaction-hash="<%= @transaction.hash %>"> <div class="tile tile-type-<%= BlockScoutWeb.TransactionView.type_suffix(@transaction) %> tile-status--<%= BlockScoutWeb.TransactionView.status(@transaction) %> fade-up" data-test="<%= BlockScoutWeb.TransactionView.type_suffix(@transaction) %>" data-transaction-hash="<%= @transaction.hash %>">
<div class="row" data-test="chain_transaction"> <div class="row" data-test="chain_transaction">
<div class="col-md-2 d-flex flex-row flex-md-column align-items-left justify-content-start justify-content-lg-center mb-1 mb-md-0 pl-md-4"> <div class="col-md-2 d-flex flex-row flex-md-column align-items-left justify-content-start justify-content-lg-center mb-1 mb-md-0 pl-md-4">
<span class="tile-label" data-test="transaction_type"> <span class="tile-label" data-test="transaction_type">
<%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %> <%= BlockScoutWeb.TransactionView.transaction_display_type(@transaction) %>
</span> </span>
<div class="tile-status-label ml-2 ml-md-0" data-test="transaction_status"> <div class="tile-status-label ml-2 ml-md-0" data-test="transaction_status">
<%= ExplorerWeb.TransactionView.formatted_status(@transaction) %> <%= BlockScoutWeb.TransactionView.formatted_status(@transaction) %>
</div> </div>
</div> </div>
<div class="col-md-7 col-lg-8 d-flex flex-column pr-2 pr-sm-2 pr-md-0"> <div class="col-md-7 col-lg-8 d-flex flex-column pr-2 pr-sm-2 pr-md-0">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %> <%= render BlockScoutWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %>
<span class="text-nowrap"> <span class="text-nowrap">
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(@transaction.from_address), locale: @locale %>
&rarr; &rarr;
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: BlockScoutWeb.TransactionView.to_address_hash(@transaction), contract: BlockScoutWeb.AddressView.contract?(@transaction.to_address), locale: @locale %>
</span> </span>
<span class="d-flex flex-md-row flex-column mt-3 mt-md-0"> <span class="d-flex flex-md-row flex-column mt-3 mt-md-0">
<span class="tile-title"> <span class="tile-title">
<%= ExplorerWeb.TransactionView.value(@transaction, include_label: false) %> <%= gettext "Ether" %> <%= BlockScoutWeb.TransactionView.value(@transaction, include_label: false) %> <%= gettext "Ether" %>
</span> </span>
<span class="ml-0 ml-md-1 text-nowrap"> <%= ExplorerWeb.TransactionView.formatted_fee(@transaction, denomination: :ether, include_label: false) %> <%= gettext "TX Fee" %></span> <span class="ml-0 ml-md-1 text-nowrap"> <%= BlockScoutWeb.TransactionView.formatted_fee(@transaction, denomination: :ether, include_label: false) %> <%= gettext "TX Fee" %></span>
</span> </span>
</div> </div>
<div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start text-md-right mt-3 mt-md-0"> <div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start text-md-right mt-3 mt-md-0">
<span class="mr-2 mr-md-0"> <span class="mr-2 mr-md-0">
<%= link( <%= link(
gettext("Block #%{number}", number: to_string(@transaction.block.number)), gettext("Block #%{number}", number: to_string(@transaction.block.number)),
to: block_path(ExplorerWeb.Endpoint, :show, @locale, @transaction.block) to: block_path(BlockScoutWeb.Endpoint, :show, @locale, @transaction.block)
) %> ) %>
</span> </span>
<span data-from-now="<%= @transaction.block.timestamp %>"></span> <span data-from-now="<%= @transaction.block.timestamp %>"></span>

@ -57,7 +57,7 @@
<p><%= gettext("Showing") %> <span data-selector="transaction-count"><%= Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %></span> <%= gettext("Validated Transactions") %></p> <p><%= gettext("Showing") %> <span data-selector="transaction-count"><%= Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %></span> <%= gettext("Validated Transactions") %></p>
<span data-selector="transactions-list"> <span data-selector="transactions-list">
<%= for transaction <- @transactions do %> <%= for transaction <- @transactions do %>
<%= render ExplorerWeb.TransactionView, "_tile.html", locale: @locale, transaction: transaction %> <%= render BlockScoutWeb.TransactionView, "_tile.html", locale: @locale, transaction: transaction %>
<% end %> <% end %>
</span> </span>

@ -8,17 +8,17 @@
<h1 class="card-title"><%= gettext "Transaction Details" %> </h1> <h1 class="card-title"><%= gettext "Transaction Details" %> </h1>
<h3 data-test="transaction_detail_hash"><%= @transaction %> </h3> <h3 data-test="transaction_detail_hash"><%= @transaction %> </h3>
<span class="d-block mb-2"> <span class="d-block mb-2">
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(@transaction.from_address), locale: @locale %>
<span class="text-muted"> &rarr; </span> <span class="text-muted"> &rarr; </span>
<%= if @transaction.to_address_hash do %> <%= if @transaction.to_address_hash do %>
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @transaction.to_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.to_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: @transaction.to_address_hash, contract: BlockScoutWeb.AddressView.contract?(@transaction.to_address), locale: @locale %>
<% else %> <% else %>
<%= gettext("Contract Address Pending") %> <%= gettext("Contract Address Pending") %>
<% end %> <% end %>
</span> </span>
<div class="d-flex flex-row justify-content-start text-muted"> <div class="d-flex flex-row justify-content-start text-muted">
<span class="mr-4 text-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %>"><%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %></span> <span class="mr-4 text-<%= BlockScoutWeb.TransactionView.type_suffix(@transaction) %>"><%= BlockScoutWeb.TransactionView.transaction_display_type(@transaction) %></span>
<span class="mr-4"><%= ExplorerWeb.TransactionView.formatted_status(@transaction) %></span> <span class="mr-4"><%= BlockScoutWeb.TransactionView.formatted_status(@transaction) %></span>
<span class="mr-4"> <span class="mr-4">
<%= if block do %> <%= if block do %>
<span data-from-now="<%= @transaction.block.timestamp %>"></span> <span data-from-now="<%= @transaction.block.timestamp %>"></span>

@ -4,15 +4,15 @@
<%= gettext("Internal Transaction") %> <%= gettext("Internal Transaction") %>
</div> </div>
<div class="col-md-9 col-lg-10 d-flex flex-column text-nowrap"> <div class="col-md-9 col-lg-10 d-flex flex-column text-nowrap">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @internal_transaction.transaction_hash %> <%= render BlockScoutWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @internal_transaction.transaction_hash %>
<span class="text-nowrap"> <span class="text-nowrap">
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.from_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: @internal_transaction.from_address_hash, contract: BlockScoutWeb.AddressView.contract?(@internal_transaction.from_address), locale: @locale %>
&rarr; &rarr;
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: ExplorerWeb.AddressView.contract?(@internal_transaction.to_address), locale: @locale %> <%= render BlockScoutWeb.AddressView, "_link.html", address_hash: BlockScoutWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: BlockScoutWeb.AddressView.contract?(@internal_transaction.to_address), locale: @locale %>
</span> </span>
<span class="tile-title text-truncate"> <span class="tile-title text-truncate">
<%= ExplorerWeb.TransactionView.value(@internal_transaction, include_label: false) %> <%= BlockScoutWeb.TransactionView.value(@internal_transaction, include_label: false) %>
<%= gettext "Ether" %> <%= gettext "Ether" %>
</span> </span>
</div> </div>

@ -1,5 +1,5 @@
<section class="container"> <section class="container">
<%= render ExplorerWeb.TransactionView, "overview.html", assigns %> <%= render BlockScoutWeb.TransactionView, "overview.html", assigns %>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">

@ -1,6 +1,6 @@
<section class="container"> <section class="container">
<%= render ExplorerWeb.TransactionView, "overview.html", assigns %> <%= render BlockScoutWeb.TransactionView, "overview.html", assigns %>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">

@ -1,3 +1,3 @@
defmodule ExplorerWeb.AddressContractVerificationView do defmodule BlockScoutWeb.AddressContractVerificationView do
use ExplorerWeb, :view use BlockScoutWeb, :view
end end

@ -1,7 +1,7 @@
defmodule ExplorerWeb.AddressContractView do defmodule BlockScoutWeb.AddressContractView do
use ExplorerWeb, :view use BlockScoutWeb, :view
import ExplorerWeb.AddressView, only: [smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1] import BlockScoutWeb.AddressView, only: [smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1]
def format_smart_contract_abi(abi), do: Poison.encode!(abi, pretty: true) def format_smart_contract_abi(abi), do: Poison.encode!(abi, pretty: true)

@ -1,7 +1,7 @@
defmodule ExplorerWeb.AddressInternalTransactionView do defmodule BlockScoutWeb.AddressInternalTransactionView do
use ExplorerWeb, :view use BlockScoutWeb, :view
import ExplorerWeb.AddressView, import BlockScoutWeb.AddressView,
only: [contract?: 1, smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1] only: [contract?: 1, smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1]
def format_current_filter(filter) do def format_current_filter(filter) do

@ -1,7 +1,7 @@
defmodule ExplorerWeb.AddressReadContractView do defmodule BlockScoutWeb.AddressReadContractView do
use ExplorerWeb, :view use BlockScoutWeb, :view
import ExplorerWeb.AddressView, only: [smart_contract_verified?: 1] import BlockScoutWeb.AddressView, only: [smart_contract_verified?: 1]
def queryable?(inputs), do: Enum.any?(inputs) def queryable?(inputs), do: Enum.any?(inputs)

@ -1,9 +1,9 @@
defmodule ExplorerWeb.AddressTransactionView do defmodule BlockScoutWeb.AddressTransactionView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias Explorer.Chain.Address alias Explorer.Chain.Address
import ExplorerWeb.AddressView, import BlockScoutWeb.AddressView,
only: [contract?: 1, smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1] only: [contract?: 1, smart_contract_verified?: 1, smart_contract_with_read_only_functions?: 1]
def format_current_filter(filter) do def format_current_filter(filter) do

@ -1,10 +1,10 @@
defmodule ExplorerWeb.AddressView do defmodule BlockScoutWeb.AddressView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias Explorer.Chain.{Address, Hash, SmartContract, Wei} alias Explorer.Chain.{Address, Hash, SmartContract, Wei}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias ExplorerWeb.ExchangeRates.USD alias BlockScoutWeb.ExchangeRates.USD
@dialyzer :no_match @dialyzer :no_match

@ -1,7 +1,7 @@
defmodule ExplorerWeb.API.RPC.AddressView do defmodule BlockScoutWeb.API.RPC.AddressView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias ExplorerWeb.API.RPC.RPCView alias BlockScoutWeb.API.RPC.RPCView
def render("balance.json", %{addresses: [address]}) do def render("balance.json", %{addresses: [address]}) do
RPCView.render("show.json", data: "#{address.fetched_balance.value}") RPCView.render("show.json", data: "#{address.fetched_balance.value}")

@ -1,8 +1,8 @@
defmodule ExplorerWeb.API.RPC.BlockView do defmodule BlockScoutWeb.API.RPC.BlockView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias Explorer.Chain.{Hash, Wei} alias Explorer.Chain.{Hash, Wei}
alias ExplorerWeb.API.RPC.RPCView alias BlockScoutWeb.API.RPC.RPCView
def render("block_reward.json", %{block: block, reward: reward}) do def render("block_reward.json", %{block: block, reward: reward}) do
reward_as_string = reward_as_string =

@ -1,5 +1,5 @@
defmodule ExplorerWeb.API.RPC.RPCView do defmodule BlockScoutWeb.API.RPC.RPCView do
use ExplorerWeb, :view use BlockScoutWeb, :view
def render("show.json", %{data: data}) do def render("show.json", %{data: data}) do
%{ %{

@ -1,5 +1,5 @@
defmodule ExplorerWeb.API.V1.SupplyView do defmodule BlockScoutWeb.API.V1.SupplyView do
use ExplorerWeb, :view use BlockScoutWeb, :view
def render("supply.json", %{total: total_supply, circulating: circulating_supply}) do def render("supply.json", %{total: total_supply, circulating: circulating_supply}) do
%{ %{

@ -1,5 +1,5 @@
defmodule ExplorerWeb.APIDocsView do defmodule BlockScoutWeb.APIDocsView do
use ExplorerWeb, :view use BlockScoutWeb, :view
def action_tile_id(module, action) do def action_tile_id(module, action) do
"#{module}-#{action}" "#{module}-#{action}"

@ -1,7 +1,7 @@
defmodule ExplorerWeb.BlockTransactionView do defmodule BlockScoutWeb.BlockTransactionView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias ExplorerWeb.BlockView alias BlockScoutWeb.BlockView
defdelegate formatted_timestamp(block), to: BlockView defdelegate formatted_timestamp(block), to: BlockView
end end

@ -1,5 +1,5 @@
defmodule ExplorerWeb.BlockView do defmodule BlockScoutWeb.BlockView do
use ExplorerWeb, :view use BlockScoutWeb, :view
import Math.Enum, only: [mean: 1] import Math.Enum, only: [mean: 1]

@ -1,8 +1,8 @@
defmodule ExplorerWeb.ChainView do defmodule BlockScoutWeb.ChainView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias ExplorerWeb.ExchangeRates.USD alias BlockScoutWeb.ExchangeRates.USD
def encode_market_history_data(market_history_data) do def encode_market_history_data(market_history_data) do
market_history_data market_history_data

@ -1,4 +1,4 @@
defmodule ExplorerWeb.Cldr.Number do defmodule BlockScoutWeb.Cldr.Number do
@moduledoc """ @moduledoc """
Work-arounds for `Cldr.Number` bugs Work-arounds for `Cldr.Number` bugs
""" """

@ -1,15 +1,15 @@
defmodule ExplorerWeb.CurrencyHelpers do defmodule BlockScoutWeb.CurrencyHelpers do
@moduledoc """ @moduledoc """
Helper functions for interacting with `t:ExplorerWeb.ExchangeRates.USD.t/0` values. Helper functions for interacting with `t:BlockScoutWeb.ExchangeRates.USD.t/0` values.
""" """
import ExplorerWeb.Gettext import BlockScoutWeb.Gettext
alias ExplorerWeb.ExchangeRates.USD alias BlockScoutWeb.ExchangeRates.USD
alias ExplorerWeb.Cldr alias BlockScoutWeb.Cldr
@doc """ @doc """
Formats a `ExplorerWeb.ExchangeRates.USD` value into USD and applies a unit label. Formats a `BlockScoutWeb.ExchangeRates.USD` value into USD and applies a unit label.
## Examples ## Examples
@ -39,7 +39,7 @@ defmodule ExplorerWeb.CurrencyHelpers do
## Examples ## Examples
iex> ExplorerWeb.CurrencyHelpers.format_integer_to_currency(1000000) iex> BlockScoutWeb.CurrencyHelpers.format_integer_to_currency(1000000)
"1,000,000" "1,000,000"
""" """
@spec format_integer_to_currency(non_neg_integer()) :: String.t() @spec format_integer_to_currency(non_neg_integer()) :: String.t()

@ -1,4 +1,4 @@
defmodule ExplorerWeb.ErrorHelpers do defmodule BlockScoutWeb.ErrorHelpers do
@moduledoc """ @moduledoc """
Conveniences for translating and building error messages. Conveniences for translating and building error messages.
""" """
@ -32,9 +32,9 @@ defmodule ExplorerWeb.ErrorHelpers do
# dgettext "errors", "is invalid" # dgettext "errors", "is invalid"
# #
if count = opts[:count] do if count = opts[:count] do
Gettext.dngettext(ExplorerWeb.Gettext, "errors", msg, msg, count, opts) Gettext.dngettext(BlockScoutWeb.Gettext, "errors", msg, msg, count, opts)
else else
Gettext.dgettext(ExplorerWeb.Gettext, "errors", msg, opts) Gettext.dgettext(BlockScoutWeb.Gettext, "errors", msg, opts)
end end
end end
end end

@ -1,5 +1,5 @@
defmodule ExplorerWeb.ErrorView do defmodule BlockScoutWeb.ErrorView do
use ExplorerWeb, :view use BlockScoutWeb, :view
def render("404.html", _assigns) do def render("404.html", _assigns) do
"Page not found" "Page not found"

@ -1,3 +1,3 @@
defmodule ExplorerWeb.IconsView do defmodule BlockScoutWeb.IconsView do
use ExplorerWeb, :view use BlockScoutWeb, :view
end end

@ -1,5 +1,5 @@
defmodule ExplorerWeb.InternalTransactionView do defmodule BlockScoutWeb.InternalTransactionView do
use ExplorerWeb, :view use BlockScoutWeb, :view
@dialyzer :no_match @dialyzer :no_match
alias Explorer.Chain.InternalTransaction alias Explorer.Chain.InternalTransaction

@ -1,7 +1,7 @@
defmodule ExplorerWeb.LayoutView do defmodule BlockScoutWeb.LayoutView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias ExplorerWeb.SocialMedia alias BlockScoutWeb.SocialMedia
def configured_social_media_services do def configured_social_media_services do
SocialMedia.links() SocialMedia.links()

@ -1,5 +1,5 @@
defmodule ExplorerWeb.PendingTransactionView do defmodule BlockScoutWeb.PendingTransactionView do
use ExplorerWeb, :view use BlockScoutWeb, :view
@dialyzer :no_match @dialyzer :no_match
end end

@ -1,10 +1,10 @@
defmodule ExplorerWeb.TokenHelpers do defmodule BlockScoutWeb.TokenHelpers do
@moduledoc """ @moduledoc """
Helper functions for intereacting with `t:ExplorerWeb.Chain.Token` attributes. Helper functions for intereacting with `t:BlockScoutWeb.Chain.Token` attributes.
""" """
alias Explorer.Chain.{Token, TokenTransfer} alias Explorer.Chain.{Token, TokenTransfer}
alias ExplorerWeb.{CurrencyHelpers} alias BlockScoutWeb.{CurrencyHelpers}
@doc """ @doc """
Returns the token transfers' amount according to the token's type and decimails. Returns the token transfers' amount according to the token's type and decimails.

@ -1,5 +1,5 @@
defmodule ExplorerWeb.TokenView do defmodule BlockScoutWeb.TokenView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias Explorer.Chain.Token alias Explorer.Chain.Token

@ -1,4 +1,4 @@
defmodule ExplorerWeb.TransactionInternalTransactionView do defmodule BlockScoutWeb.TransactionInternalTransactionView do
use ExplorerWeb, :view use BlockScoutWeb, :view
@dialyzer :no_match @dialyzer :no_match
end end

@ -1,4 +1,4 @@
defmodule ExplorerWeb.TransactionLogView do defmodule BlockScoutWeb.TransactionLogView do
use ExplorerWeb, :view use BlockScoutWeb, :view
@dialyzer :no_match @dialyzer :no_match
end end

@ -1,14 +1,14 @@
defmodule ExplorerWeb.TransactionView do defmodule BlockScoutWeb.TransactionView do
use ExplorerWeb, :view use BlockScoutWeb, :view
alias Cldr.Number alias Cldr.Number
alias Explorer.Chain alias Explorer.Chain
alias Explorer.Chain.{Address, InternalTransaction, Transaction, Wei} alias Explorer.Chain.{Address, InternalTransaction, Transaction, Wei}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias ExplorerWeb.{AddressView, BlockView} alias BlockScoutWeb.{AddressView, BlockView}
alias ExplorerWeb.ExchangeRates.USD alias BlockScoutWeb.ExchangeRates.USD
import ExplorerWeb.Gettext import BlockScoutWeb.Gettext
defguardp is_transaction_type(mod) when mod in [InternalTransaction, Transaction] defguardp is_transaction_type(mod) when mod in [InternalTransaction, Transaction]

@ -1,12 +1,12 @@
defmodule ExplorerWeb.WeiHelpers do defmodule BlockScoutWeb.WeiHelpers do
@moduledoc """ @moduledoc """
Helper functions for interacting with `t:Explorer.Chain.Wei.t/0` values. Helper functions for interacting with `t:Explorer.Chain.Wei.t/0` values.
""" """
import ExplorerWeb.Gettext import BlockScoutWeb.Gettext
alias Explorer.Chain.Wei alias Explorer.Chain.Wei
alias ExplorerWeb.Cldr alias BlockScoutWeb.Cldr
@valid_units ~w(wei gwei ether)a @valid_units ~w(wei gwei ether)a

@ -1,4 +1,4 @@
defmodule ExplorerWeb.Mixfile do defmodule BlockScoutWeb.Mixfile do
use Mix.Project use Mix.Project
def project do def project do
@ -36,7 +36,7 @@ defmodule ExplorerWeb.Mixfile do
# Type `mix help compile.app` for more information. # Type `mix help compile.app` for more information.
def application do def application do
[ [
mod: {ExplorerWeb.Application, []}, mod: {BlockScoutWeb.Application, []},
extra_applications: extra_applications() extra_applications: extra_applications()
] ]
end end

@ -1,8 +1,8 @@
defmodule ExplorerWeb.ChainTest do defmodule BlockScoutWeb.ChainTest do
use Explorer.DataCase use Explorer.DataCase
alias Explorer.Chain.{Address, Block, Transaction} alias Explorer.Chain.{Address, Block, Transaction}
alias ExplorerWeb.Chain alias BlockScoutWeb.Chain
describe "from_param/1" do describe "from_param/1" do
test "finds a block by block number with a valid block number" do test "finds a block by block number with a valid block number" do

@ -1,12 +1,12 @@
defmodule ExplorerWeb.AddressChannelTest do defmodule BlockScoutWeb.AddressChannelTest do
use ExplorerWeb.ChannelCase use BlockScoutWeb.ChannelCase
describe "addresses channel tests" do describe "addresses channel tests" do
test "subscribed user can receive transaction event" do test "subscribed user can receive transaction event" do
channel = "addresses" channel = "addresses"
@endpoint.subscribe(channel) @endpoint.subscribe(channel)
ExplorerWeb.Endpoint.broadcast(channel, "transaction", %{body: "test"}) BlockScoutWeb.Endpoint.broadcast(channel, "transaction", %{body: "test"})
receive do receive do
%Phoenix.Socket.Broadcast{event: "transaction", topic: ^channel, payload: %{body: body}} -> %Phoenix.Socket.Broadcast{event: "transaction", topic: ^channel, payload: %{body: body}} ->
@ -21,7 +21,7 @@ defmodule ExplorerWeb.AddressChannelTest do
channel = "addresses" channel = "addresses"
@endpoint.subscribe(channel) @endpoint.subscribe(channel)
ExplorerWeb.Endpoint.broadcast(channel, "overview", %{body: "test"}) BlockScoutWeb.Endpoint.broadcast(channel, "overview", %{body: "test"})
receive do receive do
%Phoenix.Socket.Broadcast{event: "overview", topic: ^channel, payload: %{body: body}} -> %Phoenix.Socket.Broadcast{event: "overview", topic: ^channel, payload: %{body: body}} ->

@ -1,5 +1,5 @@
defmodule ExplorerWeb.AddressTransactionTest do defmodule BlockScoutWeb.AddressTransactionTest do
use ExplorerWeb.ChannelCase use BlockScoutWeb.ChannelCase
describe "transactions channel tests" do describe "transactions channel tests" do
test "subscribed user can receive block confirmations event" do test "subscribed user can receive block confirmations event" do
@ -13,7 +13,7 @@ defmodule ExplorerWeb.AddressTransactionTest do
|> insert() |> insert()
|> with_block(block) |> with_block(block)
ExplorerWeb.Endpoint.broadcast(channel, "confirmations", %{max_block_number: 3, transaction: transaction}) BlockScoutWeb.Endpoint.broadcast(channel, "confirmations", %{max_block_number: 3, transaction: transaction})
receive do receive do
%Phoenix.Socket.Broadcast{ %Phoenix.Socket.Broadcast{

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save