Merge branch 'master' into realtime-pubsub-by-postges-notify

pull/2449/head
saneery 5 years ago
commit 51f6a68886
  1. 14
      CHANGELOG.md
  2. 3
      apps/block_scout_web/assets/css/components/_tile.scss
  3. 6
      apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex
  4. 25
      apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex
  5. 8
      apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex
  6. 167
      apps/block_scout_web/lib/block_scout_web/templates/chain/_block.html.eex
  7. 1
      apps/block_scout_web/lib/block_scout_web/views/internal_transaction_view.ex
  8. 2
      apps/block_scout_web/mix.exs
  9. 39
      apps/block_scout_web/priv/gettext/default.pot
  10. 43
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  11. 12
      apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs
  12. 12
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth/call.ex
  13. 6
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/geth/tracer.ex
  14. 2
      apps/ethereum_jsonrpc/mix.exs
  15. 40
      apps/ethereum_jsonrpc/priv/js/ethereum_jsonrpc/geth/debug_traceTransaction/tracer.js
  16. 6
      apps/explorer/lib/explorer/chain/internal_transaction.ex
  17. 15
      apps/explorer/lib/explorer/chain/internal_transaction/type.ex
  18. 2
      apps/explorer/mix.exs
  19. 10
      rel/commands/clear_build.sh

@ -1,5 +1,17 @@
## Current ## Current
### Features
### Fixes
- [#2425](https://github.com/poanetwork/blockscout/pull/2425) - Force to show address view for checksummed address even if it is not in DB
### Chore
- [#2450](https://github.com/poanetwork/blockscout/pull/2450) - Fix clearance of logs and node_modules folders in clearing script
- [#2434](https://github.com/poanetwork/blockscout/pull/2434) - get rid of timex warnings
## 2.0.2-beta
### Features ### Features
- [#2412](https://github.com/poanetwork/blockscout/pull/2412) - dark theme - [#2412](https://github.com/poanetwork/blockscout/pull/2412) - dark theme
- [#2399](https://github.com/poanetwork/blockscout/pull/2399) - decode verified smart contract's logs - [#2399](https://github.com/poanetwork/blockscout/pull/2399) - decode verified smart contract's logs
@ -20,8 +32,8 @@
- [#2410](https://github.com/poanetwork/blockscout/pull/2410) - preload smart contract for logs decoding - [#2410](https://github.com/poanetwork/blockscout/pull/2410) - preload smart contract for logs decoding
- [#2405](https://github.com/poanetwork/blockscout/pull/2405) - added templates for table loader and tile loader - [#2405](https://github.com/poanetwork/blockscout/pull/2405) - added templates for table loader and tile loader
- [#2398](https://github.com/poanetwork/blockscout/pull/2398) - show only one decoded candidate - [#2398](https://github.com/poanetwork/blockscout/pull/2398) - show only one decoded candidate
- [#2395](https://github.com/poanetwork/blockscout/pull/2395) - new block loading animation
- [#2389](https://github.com/poanetwork/blockscout/pull/2389) - Reduce Lodash lib size (86% of lib methods are not used) - [#2389](https://github.com/poanetwork/blockscout/pull/2389) - Reduce Lodash lib size (86% of lib methods are not used)
- [#2388](https://github.com/poanetwork/blockscout/pull/2388) - add create2 support to geth's js tracer
- [#2387](https://github.com/poanetwork/blockscout/pull/2387) - fix not existing keys in transaction json rpc - [#2387](https://github.com/poanetwork/blockscout/pull/2387) - fix not existing keys in transaction json rpc
- [#2378](https://github.com/poanetwork/blockscout/pull/2378) - Page performance: exclude moment.js localization files except EN, remove unused css - [#2378](https://github.com/poanetwork/blockscout/pull/2378) - Page performance: exclude moment.js localization files except EN, remove unused css
- [#2368](https://github.com/poanetwork/blockscout/pull/2368) - add two columns of smart contract info - [#2368](https://github.com/poanetwork/blockscout/pull/2368) - add two columns of smart contract info

@ -340,6 +340,9 @@ $tile-body-a-color: #5959d8 !default;
padding-right: 6px; padding-right: 6px;
} }
} }
.tile-type-block {
overflow: hidden;
}
.row { .row {
@include media-breakpoint-down(lg) { @include media-breakpoint-down(lg) {
margin-left: -6px; margin-left: -6px;

@ -68,6 +68,12 @@ defmodule BlockScoutWeb.AddressCoinBalanceController do
validation_count: validation_count(address_hash), validation_count: validation_count(address_hash),
current_path: current_path(conn) current_path: current_path(conn)
) )
else
:error ->
unprocessable_entity(conn)
{:error, :not_found} ->
not_found(conn)
end end
end end
end end

@ -83,7 +83,11 @@ defmodule BlockScoutWeb.AddressTransactionController do
unprocessable_entity(conn) unprocessable_entity(conn)
{:error, :not_found} -> {:error, :not_found} ->
not_found(conn) with {:ok, _} <- Chain.Hash.Address.validate(address_hash_string) do
json(conn, %{items: [], next_page_path: ""})
else
{:error, _} -> not_found(conn)
end
end end
end end
@ -106,7 +110,24 @@ defmodule BlockScoutWeb.AddressTransactionController do
unprocessable_entity(conn) unprocessable_entity(conn)
{:error, :not_found} -> {:error, :not_found} ->
not_found(conn) {:ok, address_hash} = Chain.string_to_address_hash(address_hash_string)
address = %Chain.Address{hash: address_hash, smart_contract: nil, token: nil}
with {:ok, _} <- Chain.Hash.Address.validate(address_hash_string) do
render(
conn,
"index.html",
address: address,
coin_balance_status: nil,
exchange_rate: Market.get_exchange_rate(Explorer.coin()) || Token.null(),
filter: params["filter"],
transaction_count: 0,
validation_count: 0,
current_path: current_path(conn)
)
else
{:error, _} -> not_found(conn)
end
end end
end end

@ -84,9 +84,11 @@
<%= gettext("Transactions Sent") %> <%= gettext("Transactions Sent") %>
<% end %> <% end %>
</span> </span>
<span class="address-detail-item"> <%= if @address.fetched_coin_balance_block_number do %>
<%= gettext("Last Balance Update: Block #") %><span data-selector="fetched-coin-balance-block-number"><%= @address.fetched_coin_balance_block_number %></span> <span class="address-detail-item">
</span> <%= gettext("Last Balance Update: Block #") %><span data-selector="fetched-coin-balance-block-number"><%= @address.fetched_coin_balance_block_number %></span>
</span>
<% end %>
<%= if validator?(@validation_count) do %> <%= if validator?(@validation_count) do %>
<span class="address-detail-item"> <span class="address-detail-item">
<span data-selector="validation-count"> <span data-selector="validation-count">

@ -1,172 +1,5 @@
<div class="col-lg-3 fade-up-blocks-chain" data-selector="chain-block" data-block-number="<%= @block.number %>"> <div class="col-lg-3 fade-up-blocks-chain" data-selector="chain-block" data-block-number="<%= @block.number %>">
<div class="tile tile-type-block n-p d-flex flex-column"> <div class="tile tile-type-block n-p d-flex flex-column">
<div class="tile-type-block-animation">
<div class="tile-type-line-up"></div>
<span class="cube-animation-title">Block Validated, processing...</span>
<div class="cube-animation-wrapper">
<div class="cube-animation-center">
<div class="cube-animation-row">
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
</div>
<div class="cube-animation-row">
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
</div>
<div class="cube-animation-row">
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
<div class="cube-animation-column">
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
<svg class="cube" viewBox="0 0 86.6 100" x="0px" y="0px">
<polygon class="side" points="43.3,0 0,25 0,75 43.3,100 86.6,75 86.6,25 "></polygon>
<polygon class="side" points="86.6,25 43.3,50 43.3,100 86.6,75 "></polygon>
<polygon class="side" points="0,25 43.3,0 86.6,25 43.3,50 "></polygon>
</svg>
</div>
</div>
</div>
</div>
</div>
<%= link( <%= link(
@block, @block,
class: "tile-title", class: "tile-title",

@ -23,6 +23,7 @@ defmodule BlockScoutWeb.InternalTransactionView do
def type(%InternalTransaction{type: :call, call_type: :delegatecall}), do: gettext("Delegate Call") def type(%InternalTransaction{type: :call, call_type: :delegatecall}), do: gettext("Delegate Call")
def type(%InternalTransaction{type: :call, call_type: :staticcall}), do: gettext("Static Call") def type(%InternalTransaction{type: :call, call_type: :staticcall}), do: gettext("Static Call")
def type(%InternalTransaction{type: :create}), do: gettext("Create") def type(%InternalTransaction{type: :create}), do: gettext("Create")
def type(%InternalTransaction{type: :create2}), do: gettext("Create2")
def type(%InternalTransaction{type: :selfdestruct}), do: gettext("Self-Destruct") def type(%InternalTransaction{type: :selfdestruct}), do: gettext("Self-Destruct")
def type(%InternalTransaction{type: :reward}), do: gettext("Reward") def type(%InternalTransaction{type: :reward}), do: gettext("Reward")
end end

@ -125,7 +125,7 @@ defmodule BlockScoutWeb.Mixfile do
{:spandex_datadog, "~> 0.4.0"}, {:spandex_datadog, "~> 0.4.0"},
# `:spandex` tracing of `:phoenix` # `:spandex` tracing of `:phoenix`
{:spandex_phoenix, "~> 0.3.1"}, {:spandex_phoenix, "~> 0.3.1"},
{:timex, "~> 3.4"}, {:timex, "~> 3.6"},
{:wallaby, "~> 0.22", only: [:test], runtime: false}, {:wallaby, "~> 0.22", only: [:test], runtime: false},
# `:cowboy` `~> 2.0` and Phoenix 1.4 compatibility # `:cowboy` `~> 2.0` and Phoenix 1.4 compatibility
{:wobserver, "~> 0.2.0", github: "poanetwork/wobserver", branch: "support-https"}, {:wobserver, "~> 0.2.0", github: "poanetwork/wobserver", branch: "support-https"},

@ -34,7 +34,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:21 #: lib/block_scout_web/templates/block/overview.html.eex:21
#: lib/block_scout_web/templates/chain/_block.html.eex:178 #: lib/block_scout_web/templates/chain/_block.html.eex:11
msgid "%{count} Transactions" msgid "%{count} Transactions"
msgstr "" msgstr ""
@ -190,7 +190,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:32 #: lib/block_scout_web/templates/address/_tabs.html.eex:32
#: lib/block_scout_web/templates/address/overview.html.eex:95 #: lib/block_scout_web/templates/address/overview.html.eex:97
#: lib/block_scout_web/templates/address_validation/index.html.eex:13 #: lib/block_scout_web/templates/address_validation/index.html.eex:13
#: lib/block_scout_web/views/address_view.ex:311 #: lib/block_scout_web/views/address_view.ex:311
msgid "Blocks Validated" msgid "Blocks Validated"
@ -209,8 +209,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37 #: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37
#: lib/block_scout_web/templates/address/overview.html.eex:144 #: lib/block_scout_web/templates/address/overview.html.eex:146
#: lib/block_scout_web/templates/address/overview.html.eex:152 #: lib/block_scout_web/templates/address/overview.html.eex:154
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:107 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:107
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115
msgid "Close" msgid "Close"
@ -319,7 +319,7 @@ msgid "Copy Txn Hash"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:105 #: lib/block_scout_web/templates/address/overview.html.eex:107
msgid "Created by" msgid "Created by"
msgstr "" msgstr ""
@ -514,7 +514,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:38 #: lib/block_scout_web/templates/block/_tile.html.eex:38
#: lib/block_scout_web/templates/block/overview.html.eex:121 #: lib/block_scout_web/templates/block/overview.html.eex:121
#: lib/block_scout_web/templates/chain/_block.html.eex:182 #: lib/block_scout_web/templates/chain/_block.html.eex:15
msgid "Miner" msgid "Miner"
msgstr "" msgstr ""
@ -621,7 +621,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:33 #: lib/block_scout_web/templates/address/overview.html.eex:33
#: lib/block_scout_web/templates/address/overview.html.eex:143 #: lib/block_scout_web/templates/address/overview.html.eex:145
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106
msgid "QR Code" msgid "QR Code"
@ -983,7 +983,7 @@ msgid "Yes"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:111 #: lib/block_scout_web/templates/address/overview.html.eex:113
msgid "at" msgid "at"
msgstr "" msgstr ""
@ -1026,14 +1026,7 @@ msgid "Delegate Call"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:47
#: lib/block_scout_web/templates/chain/_block.html.eex:190
#: lib/block_scout_web/views/internal_transaction_view.ex:27 #: lib/block_scout_web/views/internal_transaction_view.ex:27
msgid "Reward"
msgstr ""
#, elixir-format
#: lib/block_scout_web/views/internal_transaction_view.ex:26
msgid "Self-Destruct" msgid "Self-Destruct"
msgstr "" msgstr ""
@ -1386,7 +1379,7 @@ msgid "Contract Libraries"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:88 #: lib/block_scout_web/templates/address/overview.html.eex:89
msgid "Last Balance Update: Block #" msgid "Last Balance Update: Block #"
msgstr "" msgstr ""
@ -1432,7 +1425,7 @@ msgid "Incoming Transactions"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:119 #: lib/block_scout_web/templates/address/overview.html.eex:121
msgid "Error: Could not determine contract creator." msgid "Error: Could not determine contract creator."
msgstr "" msgstr ""
@ -1766,6 +1759,11 @@ msgstr ""
msgid "Copy Value" msgid "Copy Value"
msgstr "" msgstr ""
#, elixir-format
#: lib/block_scout_web/views/internal_transaction_view.ex:26
msgid "Create2"
msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:49
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:114 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:114
@ -1793,6 +1791,13 @@ msgstr ""
msgid "Log Data" msgid "Log Data"
msgstr "" msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:47
#: lib/block_scout_web/templates/chain/_block.html.eex:23
#: lib/block_scout_web/views/internal_transaction_view.ex:28
msgid "Reward"
msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:84 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:84
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85

@ -34,7 +34,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/overview.html.eex:21 #: lib/block_scout_web/templates/block/overview.html.eex:21
#: lib/block_scout_web/templates/chain/_block.html.eex:178 #: lib/block_scout_web/templates/chain/_block.html.eex:11
msgid "%{count} Transactions" msgid "%{count} Transactions"
msgstr "" msgstr ""
@ -190,7 +190,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:32 #: lib/block_scout_web/templates/address/_tabs.html.eex:32
#: lib/block_scout_web/templates/address/overview.html.eex:95 #: lib/block_scout_web/templates/address/overview.html.eex:97
#: lib/block_scout_web/templates/address_validation/index.html.eex:13 #: lib/block_scout_web/templates/address_validation/index.html.eex:13
#: lib/block_scout_web/views/address_view.ex:311 #: lib/block_scout_web/views/address_view.ex:311
msgid "Blocks Validated" msgid "Blocks Validated"
@ -209,8 +209,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37 #: lib/block_scout_web/templates/address/_validator_metadata_modal.html.eex:37
#: lib/block_scout_web/templates/address/overview.html.eex:144 #: lib/block_scout_web/templates/address/overview.html.eex:146
#: lib/block_scout_web/templates/address/overview.html.eex:152 #: lib/block_scout_web/templates/address/overview.html.eex:154
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:107 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:107
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:115
msgid "Close" msgid "Close"
@ -319,7 +319,7 @@ msgid "Copy Txn Hash"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:105 #: lib/block_scout_web/templates/address/overview.html.eex:107
msgid "Created by" msgid "Created by"
msgstr "" msgstr ""
@ -514,7 +514,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:38 #: lib/block_scout_web/templates/block/_tile.html.eex:38
#: lib/block_scout_web/templates/block/overview.html.eex:121 #: lib/block_scout_web/templates/block/overview.html.eex:121
#: lib/block_scout_web/templates/chain/_block.html.eex:182 #: lib/block_scout_web/templates/chain/_block.html.eex:15
msgid "Miner" msgid "Miner"
msgstr "" msgstr ""
@ -621,7 +621,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:33 #: lib/block_scout_web/templates/address/overview.html.eex:33
#: lib/block_scout_web/templates/address/overview.html.eex:143 #: lib/block_scout_web/templates/address/overview.html.eex:145
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:36
#: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106 #: lib/block_scout_web/templates/tokens/overview/_details.html.eex:106
msgid "QR Code" msgid "QR Code"
@ -983,7 +983,7 @@ msgid "Yes"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:111 #: lib/block_scout_web/templates/address/overview.html.eex:113
msgid "at" msgid "at"
msgstr "" msgstr ""
@ -1026,14 +1026,7 @@ msgid "Delegate Call"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:47
#: lib/block_scout_web/templates/chain/_block.html.eex:190
#: lib/block_scout_web/views/internal_transaction_view.ex:27 #: lib/block_scout_web/views/internal_transaction_view.ex:27
msgid "Reward"
msgstr ""
#, elixir-format
#: lib/block_scout_web/views/internal_transaction_view.ex:26
msgid "Self-Destruct" msgid "Self-Destruct"
msgstr "" msgstr ""
@ -1387,7 +1380,7 @@ msgid "Contract Libraries"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:88 #: lib/block_scout_web/templates/address/overview.html.eex:89
msgid "Last Balance Update: Block #" msgid "Last Balance Update: Block #"
msgstr "" msgstr ""
@ -1433,7 +1426,7 @@ msgid "Incoming Transactions"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:119 #: lib/block_scout_web/templates/address/overview.html.eex:121
msgid "Error: Could not determine contract creator." msgid "Error: Could not determine contract creator."
msgstr "" msgstr ""
@ -1767,7 +1760,12 @@ msgstr ""
msgid "Copy Value" msgid "Copy Value"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/views/internal_transaction_view.ex:26
msgid "Create2"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:49 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:49
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:114 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:114
#: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21 #: lib/block_scout_web/templates/transaction/_decoded_input_body.html.eex:21
@ -1794,7 +1792,14 @@ msgstr ""
msgid "Log Data" msgid "Log Data"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:47
#: lib/block_scout_web/templates/chain/_block.html.eex:23
#: lib/block_scout_web/views/internal_transaction_view.ex:28
msgid "Reward"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:84 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:84
#: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85 #: lib/block_scout_web/templates/transaction_log/_logs.html.eex:85
msgid "Topics" msgid "Topics"

@ -13,10 +13,16 @@ defmodule BlockScoutWeb.AddressTransactionControllerTest do
assert html_response(conn, 422) assert html_response(conn, 422)
end end
test "with valid address hash without address", %{conn: conn} do test "with valid address hash without address in the DB", %{conn: conn} do
conn = get(conn, address_transaction_path(conn, :index, "0x8bf38d4764929064f2d4d3a56520a76ab3df415b")) conn =
get(
conn,
address_transaction_path(conn, :index, "0x8bf38d4764929064f2d4d3a56520a76ab3df415b", %{"type" => "JSON"})
)
assert html_response(conn, 404) assert json_response(conn, 200)
transaction_tiles = json_response(conn, 200)["items"]
assert transaction_tiles |> length() == 0
end end
test "returns transactions for the address", %{conn: conn} do test "returns transactions for the address", %{conn: conn} do

@ -426,13 +426,14 @@ defmodule EthereumJSONRPC.Geth.Call do
"transactionHash" => transaction_hash, "transactionHash" => transaction_hash,
"index" => index, "index" => index,
"traceAddress" => trace_address, "traceAddress" => trace_address,
"type" => "create" = type, "type" => type,
"from" => from_address_hash, "from" => from_address_hash,
"error" => error, "error" => error,
"gas" => gas, "gas" => gas,
"init" => init, "init" => init,
"value" => value "value" => value
}) do })
when type in ~w(create create2) do
%{ %{
block_number: block_number, block_number: block_number,
transaction_index: transaction_index, transaction_index: transaction_index,
@ -454,7 +455,7 @@ defmodule EthereumJSONRPC.Geth.Call do
"transactionHash" => transaction_hash, "transactionHash" => transaction_hash,
"index" => index, "index" => index,
"traceAddress" => trace_address, "traceAddress" => trace_address,
"type" => "create", "type" => type,
"from" => from_address_hash, "from" => from_address_hash,
"createdContractAddressHash" => created_contract_address_hash, "createdContractAddressHash" => created_contract_address_hash,
"gas" => gas, "gas" => gas,
@ -462,14 +463,15 @@ defmodule EthereumJSONRPC.Geth.Call do
"init" => init, "init" => init,
"createdContractCode" => created_contract_code, "createdContractCode" => created_contract_code,
"value" => value "value" => value
}) do })
when type in ~w(create create2) do
%{ %{
block_number: block_number, block_number: block_number,
transaction_index: transaction_index, transaction_index: transaction_index,
transaction_hash: transaction_hash, transaction_hash: transaction_hash,
index: index, index: index,
trace_address: trace_address, trace_address: trace_address,
type: "create", type: type,
from_address_hash: from_address_hash, from_address_hash: from_address_hash,
gas: gas, gas: gas,
gas_used: gas_used, gas_used: gas_used,

@ -113,6 +113,7 @@ defmodule EthereumJSONRPC.Geth.Tracer do
end end
defp op(%{"op" => "CREATE"} = log, ctx), do: create_op(log, ctx) defp op(%{"op" => "CREATE"} = log, ctx), do: create_op(log, ctx)
defp op(%{"op" => "CREATE2"} = log, ctx), do: create_op(log, ctx, "create2")
defp op(%{"op" => "SELFDESTRUCT"} = log, ctx), do: self_destruct_op(log, ctx) defp op(%{"op" => "SELFDESTRUCT"} = log, ctx), do: self_destruct_op(log, ctx)
defp op(%{"op" => "CALL"} = log, ctx), do: call_op(log, "call", ctx) defp op(%{"op" => "CALL"} = log, ctx), do: call_op(log, "call", ctx)
defp op(%{"op" => "CALLCODE"} = log, ctx), do: call_op(log, "callcode", ctx) defp op(%{"op" => "CALLCODE"} = log, ctx), do: call_op(log, "callcode", ctx)
@ -155,7 +156,8 @@ defmodule EthereumJSONRPC.Geth.Tracer do
defp create_op( defp create_op(
%{"stack" => log_stack, "memory" => log_memory}, %{"stack" => log_stack, "memory" => log_memory},
%{depth: stack_depth, stack: stack, trace_address: trace_address, calls: calls} = ctx %{depth: stack_depth, stack: stack, trace_address: trace_address, calls: calls} = ctx,
type \\ "create"
) do ) do
[value, input_offset, input_length | _] = Enum.reverse(log_stack) [value, input_offset, input_length | _] = Enum.reverse(log_stack)
@ -165,7 +167,7 @@ defmodule EthereumJSONRPC.Geth.Tracer do
|> String.slice(quantity_to_integer("0x" <> input_offset) * 2, quantity_to_integer("0x" <> input_length) * 2) |> String.slice(quantity_to_integer("0x" <> input_offset) * 2, quantity_to_integer("0x" <> input_length) * 2)
call = %{ call = %{
"type" => "create", "type" => type,
"from" => nil, "from" => nil,
"traceAddress" => Enum.reverse(trace_address), "traceAddress" => Enum.reverse(trace_address),
"init" => "0x" <> init, "init" => "0x" <> init,

@ -82,7 +82,7 @@ defmodule EthereumJsonrpc.MixProject do
# `:spandex` integration with Datadog # `:spandex` integration with Datadog
{:spandex_datadog, "~> 0.4.0"}, {:spandex_datadog, "~> 0.4.0"},
# Convert unix timestamps in JSONRPC to DateTimes # Convert unix timestamps in JSONRPC to DateTimes
{:timex, "~> 3.4"}, {:timex, "~> 3.6"},
# Encode/decode function names and arguments # Encode/decode function names and arguments
{:ex_abi, "~> 0.1.18"}, {:ex_abi, "~> 0.1.18"},
# `:verify_fun` for `Socket.Web.connect` # `:verify_fun` for `Socket.Web.connect`

@ -91,6 +91,9 @@
case 'CREATE': case 'CREATE':
this.createOp(log); this.createOp(log);
break; break;
case 'CREATE2':
this.create2Op(log);
break;
case 'SELFDESTRUCT': case 'SELFDESTRUCT':
this.selfDestructOp(log, db); this.selfDestructOp(log, db);
break; break;
@ -127,7 +130,7 @@
const ret = log.stack.peek(0); const ret = log.stack.peek(0);
if (!ret.equals(0)) { if (!ret.equals(0)) {
if (call.type === 'create') { if (call.type === 'create' || call.type === 'create2') {
call.createdContractAddressHash = toHex(toAddress(ret.toString(16))); call.createdContractAddressHash = toHex(toAddress(ret.toString(16)));
call.createdContractCode = toHex(db.getCode(toAddress(ret.toString(16)))); call.createdContractCode = toHex(db.getCode(toAddress(ret.toString(16))));
} else { } else {
@ -162,6 +165,21 @@
this.callStack.push(call); this.callStack.push(call);
}, },
create2Op(log) {
const inputOffset = log.stack.peek(1).valueOf();
const inputLength = log.stack.peek(2).valueOf();
const inputEnd = inputOffset + inputLength;
const stackValue = log.stack.peek(0);
const call = {
type: 'create2',
from: toHex(log.contract.getAddress()),
init: toHex(log.memory.slice(inputOffset, inputEnd)),
valueBigInt: bigInt(stackValue.toString(10))
};
this.callStack.push(call);
},
selfDestructOp(log, db) { selfDestructOp(log, db) {
const contractAddress = log.contract.getAddress(); const contractAddress = log.contract.getAddress();
@ -243,6 +261,9 @@
case 'CREATE': case 'CREATE':
result = this.ctxToCreate(ctx, db); result = this.ctxToCreate(ctx, db);
break; break;
case 'CREATE2':
result = this.ctxToCreate2(ctx, db);
break;
} }
return result; return result;
@ -292,6 +313,22 @@
return result; return result;
}, },
ctxToCreate2(ctx, db) {
const result = {
type: 'create2',
from: toHex(ctx.from),
init: toHex(ctx.input),
valueBigInt: bigInt(ctx.value.toString(10)),
gasBigInt: bigInt(ctx.gas),
gasUsedBigInt: bigInt(ctx.gasUsed)
};
this.putBottomChildCalls(result);
this.putErrorOrCreatedContract(result, ctx, db);
return result;
},
putBottomChildCalls(result) { putBottomChildCalls(result) {
const bottomCall = this.bottomCall(); const bottomCall = this.bottomCall();
const bottomChildCalls = bottomCall.calls; const bottomChildCalls = bottomCall.calls;
@ -422,4 +459,3 @@
call.gasUsed = '0x' + gasUsedBigInt.toString(16); call.gasUsed = '0x' + gasUsedBigInt.toString(16);
} }
} }

@ -392,7 +392,7 @@ defmodule Explorer.Chain.InternalTransaction do
@create_required_fields ~w(from_address_hash gas index init trace_address transaction_hash value)a @create_required_fields ~w(from_address_hash gas index init trace_address transaction_hash value)a
@create_allowed_fields @create_optional_fields ++ @create_required_fields @create_allowed_fields @create_optional_fields ++ @create_required_fields
defp type_changeset(changeset, attrs, :create) do defp type_changeset(changeset, attrs, type) when type in [:create, :create2] do
changeset changeset
|> cast(attrs, @create_allowed_fields) |> cast(attrs, @create_allowed_fields)
|> validate_required(@create_required_fields) |> validate_required(@create_required_fields)
@ -537,7 +537,7 @@ defmodule Explorer.Chain.InternalTransaction do
|> put_raw_call_error_or_result(transaction) |> put_raw_call_error_or_result(transaction)
end end
defp internal_transaction_to_raw(%{type: :create} = transaction) do defp internal_transaction_to_raw(%{type: type} = transaction) when type in [:create, :create2] do
%{ %{
from_address_hash: from_address_hash, from_address_hash: from_address_hash,
gas: gas, gas: gas,
@ -549,7 +549,7 @@ defmodule Explorer.Chain.InternalTransaction do
action = %{"from" => from_address_hash, "gas" => gas, "init" => init, "value" => value} action = %{"from" => from_address_hash, "gas" => gas, "init" => init, "value" => value}
%{ %{
"type" => "create", "type" => Atom.to_string(type),
"action" => Action.to_raw(action), "action" => Action.to_raw(action),
"traceAddress" => trace_address "traceAddress" => trace_address
} }

@ -11,7 +11,7 @@ defmodule Explorer.Chain.InternalTransaction.Type do
* `:reward` * `:reward`
* `:selfdestruct` * `:selfdestruct`
""" """
@type t :: :call | :create | :reward | :selfdestruct @type t :: :call | :create | :create2 | :reward | :selfdestruct
@doc """ @doc """
Casts `term` to `t:t/0` Casts `term` to `t:t/0`
@ -22,6 +22,8 @@ defmodule Explorer.Chain.InternalTransaction.Type do
{:ok, :call} {:ok, :call}
iex> Explorer.Chain.InternalTransaction.Type.cast(:create) iex> Explorer.Chain.InternalTransaction.Type.cast(:create)
{:ok, :create} {:ok, :create}
iex> Explorer.Chain.InternalTransaction.Type.cast(:create2)
{:ok, :create2}
iex> Explorer.Chain.InternalTransaction.Type.cast(:reward) iex> Explorer.Chain.InternalTransaction.Type.cast(:reward)
{:ok, :reward} {:ok, :reward}
iex> Explorer.Chain.InternalTransaction.Type.cast(:selfdestruct) iex> Explorer.Chain.InternalTransaction.Type.cast(:selfdestruct)
@ -33,6 +35,8 @@ defmodule Explorer.Chain.InternalTransaction.Type do
{:ok, :call} {:ok, :call}
iex> Explorer.Chain.InternalTransaction.Type.cast("create") iex> Explorer.Chain.InternalTransaction.Type.cast("create")
{:ok, :create} {:ok, :create}
iex> Explorer.Chain.InternalTransaction.Type.cast("create2")
{:ok, :create2}
iex> Explorer.Chain.InternalTransaction.Type.cast("reward") iex> Explorer.Chain.InternalTransaction.Type.cast("reward")
{:ok, :reward} {:ok, :reward}
iex> Explorer.Chain.InternalTransaction.Type.cast("selfdestruct") iex> Explorer.Chain.InternalTransaction.Type.cast("selfdestruct")
@ -53,9 +57,10 @@ defmodule Explorer.Chain.InternalTransaction.Type do
""" """
@impl Ecto.Type @impl Ecto.Type
@spec cast(term()) :: {:ok, t()} | :error @spec cast(term()) :: {:ok, t()} | :error
def cast(t) when t in ~w(call create selfdestruct reward)a, do: {:ok, t} def cast(t) when t in ~w(call create create2 selfdestruct reward)a, do: {:ok, t}
def cast("call"), do: {:ok, :call} def cast("call"), do: {:ok, :call}
def cast("create"), do: {:ok, :create} def cast("create"), do: {:ok, :create}
def cast("create2"), do: {:ok, :create2}
def cast("reward"), do: {:ok, :reward} def cast("reward"), do: {:ok, :reward}
def cast("selfdestruct"), do: {:ok, :selfdestruct} def cast("selfdestruct"), do: {:ok, :selfdestruct}
def cast(_), do: :error def cast(_), do: :error
@ -67,6 +72,8 @@ defmodule Explorer.Chain.InternalTransaction.Type do
{:ok, "call"} {:ok, "call"}
iex> Explorer.Chain.InternalTransaction.Type.dump(:create) iex> Explorer.Chain.InternalTransaction.Type.dump(:create)
{:ok, "create"} {:ok, "create"}
iex> Explorer.Chain.InternalTransaction.Type.dump(:create2)
{:ok, "create2"}
iex> Explorer.Chain.InternalTransaction.Type.dump(:reward) iex> Explorer.Chain.InternalTransaction.Type.dump(:reward)
{:ok, "reward"} {:ok, "reward"}
iex> Explorer.Chain.InternalTransaction.Type.dump(:selfdestruct) iex> Explorer.Chain.InternalTransaction.Type.dump(:selfdestruct)
@ -87,6 +94,7 @@ defmodule Explorer.Chain.InternalTransaction.Type do
@spec dump(term()) :: {:ok, String.t()} | :error @spec dump(term()) :: {:ok, String.t()} | :error
def dump(:call), do: {:ok, "call"} def dump(:call), do: {:ok, "call"}
def dump(:create), do: {:ok, "create"} def dump(:create), do: {:ok, "create"}
def dump(:create2), do: {:ok, "create2"}
def dump(:reward), do: {:ok, "reward"} def dump(:reward), do: {:ok, "reward"}
def dump(:selfdestruct), do: {:ok, "selfdestruct"} def dump(:selfdestruct), do: {:ok, "selfdestruct"}
def dump(_), do: :error def dump(_), do: :error
@ -98,6 +106,8 @@ defmodule Explorer.Chain.InternalTransaction.Type do
{:ok, :call} {:ok, :call}
iex> Explorer.Chain.InternalTransaction.Type.load("create") iex> Explorer.Chain.InternalTransaction.Type.load("create")
{:ok, :create} {:ok, :create}
iex> Explorer.Chain.InternalTransaction.Type.load("create2")
{:ok, :create2}
iex> Explorer.Chain.InternalTransaction.Type.load("reward") iex> Explorer.Chain.InternalTransaction.Type.load("reward")
{:ok, :reward} {:ok, :reward}
iex> Explorer.Chain.InternalTransaction.Type.load("selfdestruct") iex> Explorer.Chain.InternalTransaction.Type.load("selfdestruct")
@ -118,6 +128,7 @@ defmodule Explorer.Chain.InternalTransaction.Type do
@spec load(term()) :: {:ok, t()} | :error @spec load(term()) :: {:ok, t()} | :error
def load("call"), do: {:ok, :call} def load("call"), do: {:ok, :call}
def load("create"), do: {:ok, :create} def load("create"), do: {:ok, :create}
def load("create2"), do: {:ok, :create2}
def load("reward"), do: {:ok, :reward} def load("reward"), do: {:ok, :reward}
def load("selfdestruct"), do: {:ok, :selfdestruct} def load("selfdestruct"), do: {:ok, :selfdestruct}
# deprecated # deprecated

@ -117,7 +117,7 @@ defmodule Explorer.Mixfile do
# Attach `:prometheus_ecto` to `:ecto` # Attach `:prometheus_ecto` to `:ecto`
{:telemetry, "~> 0.3.0"}, {:telemetry, "~> 0.3.0"},
# `Timex.Duration` for `Explorer.Counters.AverageBlockTime.average_block_time/0` # `Timex.Duration` for `Explorer.Counters.AverageBlockTime.average_block_time/0`
{:timex, "~> 3.4"}, {:timex, "~> 3.6"},
{:con_cache, "~> 0.13"} {:con_cache, "~> 0.13"}
] ]
end end

@ -2,11 +2,13 @@
rm -rf ./_build rm -rf ./_build
rm -rf ./deps rm -rf ./deps
rm -rf ./logs/dev logs=$(find . -not -path '*/\.*' -name "logs" -type d)
rm -rf ./apps/explorer/node_modules dev=$(find ${logs} -name "dev")
rm -rf ./apps/block_scout_web/assets/node_modules rm -rf {ls -la ${dev}}
find . -name "node_modules" -type d -exec rm -rf '{}' +
case "$1" in case "$1" in
-f) -f)
rm -rf ./apps/block_scout_web/priv/static;; rm -rf ./apps/block_scout_web/priv/static;;
esac esac

Loading…
Cancel
Save