Merge branch 'master' into exchange-rate-disable

pull/1855/head
saneery 6 years ago
commit 23b5355f23
  1. 2
      CHANGELOG.md
  2. 3
      apps/block_scout_web/assets/css/components/_dropdown.scss
  3. 8
      apps/block_scout_web/assets/css/components/_navbar.scss
  4. 12
      apps/block_scout_web/config/config.exs
  5. 14
      apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex
  6. 9
      apps/block_scout_web/lib/block_scout_web/views/layout_view.ex
  7. 6
      apps/block_scout_web/priv/gettext/default.pot
  8. 6
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  9. 10
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex
  10. 2
      apps/ethereum_jsonrpc/mix.exs
  11. 7
      apps/explorer/lib/explorer/etherscan/logs.ex
  12. 2
      apps/explorer/priv/compile_solc.js
  13. 4
      apps/explorer/test/explorer/validator/metadata_retriever_test.exs

@ -12,6 +12,8 @@
- [#1830](https://github.com/poanetwork/blockscout/pull/1830) - Make block size field nullable - [#1830](https://github.com/poanetwork/blockscout/pull/1830) - Make block size field nullable
- [#1840](https://github.com/poanetwork/blockscout/pull/1840) - Handle case when total supply is nil - [#1840](https://github.com/poanetwork/blockscout/pull/1840) - Handle case when total supply is nil
- [#1838](https://github.com/poanetwork/blockscout/pull/1838) - Block counter calculates only consensus blocks - [#1838](https://github.com/poanetwork/blockscout/pull/1838) - Block counter calculates only consensus blocks
- [#1849](https://github.com/poanetwork/blockscout/pull/1849) - Improve chains menu
- [#1868](https://github.com/poanetwork/blockscout/pull/1868) - fix: logs list endpoint performance
### Chore ### Chore

@ -45,6 +45,7 @@
&, &,
&:hover, &:hover,
&:active { &:active {
padding-left: 10px;
background-color: transparent; background-color: transparent;
cursor: default; cursor: default;
color: #333; color: #333;
@ -53,7 +54,7 @@
} }
&.division { &.division {
border-color: $base-border-color; border-top: 1px solid $base-border-color;
} }
} }

@ -217,14 +217,6 @@ $navbar-logo-width: auto !default;
padding-left: $header-link-horizontal-padding; padding-left: $header-link-horizontal-padding;
padding-right: $header-link-horizontal-padding; padding-right: $header-link-horizontal-padding;
} }
&.header {
font-weight: bold;
&.division {
border-top: 1px solid rgb(183, 185, 184);
}
}
} }
.add-border { .add-border {

@ -68,19 +68,23 @@ config :block_scout_web,
}, },
%{ %{
title: "Ethereum Classic", title: "Ethereum Classic",
url: "https://blockscout.com/etc/mainnet" url: "https://blockscout.com/etc/mainnet",
other?: true
}, },
%{ %{
title: "Aerum Mainnet", title: "Aerum Mainnet",
url: "https://blockscout.com/aerum/mainnet" url: "https://blockscout.com/aerum/mainnet",
other?: true
}, },
%{ %{
title: "Callisto Mainnet", title: "Callisto Mainnet",
url: "https://blockscout.com/callisto/mainnet" url: "https://blockscout.com/callisto/mainnet",
other?: true
}, },
%{ %{
title: "RSK Mainnet", title: "RSK Mainnet",
url: "https://blockscout.com/rsk/mainnet" url: "https://blockscout.com/rsk/mainnet",
other?: true
} }
] ]

@ -84,13 +84,17 @@
<%= subnetwork_title() %> <%= subnetwork_title() %>
</a> </a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> <div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item header">Mainnet</a> <a class="dropdown-item header division">Mainnets</a>
<%= for %{url: url, title: title} <- main_nets() do %> <%= for %{url: url, title: title} <- head_main_nets() do %>
<a class="dropdown-item" href="<%= url%>"><%= title %></a> <a class="dropdown-item" href="<%= url%>"><%= title %></a>
<% end %> <% end %>
<a class="dropdown-item header division">Testnet</a> <a class="dropdown-item header division">Testnets</a>
<%= for %{url: url, title: title} <- test_nets() do %> <%= for %{url: url, title: title} <- test_nets() do %>
<a class="dropdown-item" href="<%= url%>"><%= title %></a> <a class="dropdown-item" href="<%= url%>"><%= title %></a>
<% end %>
<a class="dropdown-item header division">Other networks</a>
<%= for %{url: url, title: title} <- other_nets() do %>
<a class="dropdown-item" href="<%= url%>"><%= title %></a>
<% end %> <% end %>
</div> </div>
</li> </li>

@ -107,10 +107,19 @@ defmodule BlockScoutWeb.LayoutView do
Enum.reject(other_networks(), &Map.get(&1, :test_net?)) Enum.reject(other_networks(), &Map.get(&1, :test_net?))
end end
def head_main_nets do
main_nets()
|> Enum.reject(&Map.get(&1, :other?))
end
def test_nets do def test_nets do
Enum.filter(other_networks(), &Map.get(&1, :test_net?)) Enum.filter(other_networks(), &Map.get(&1, :test_net?))
end end
def other_nets do
Enum.filter(other_networks(), &Map.get(&1, :other?))
end
def other_explorers do def other_explorers do
if Application.get_env(:block_scout_web, :link_to_other_explorers) do if Application.get_env(:block_scout_web, :link_to_other_explorers) do
Application.get_env(:block_scout_web, :other_explorers, []) Application.get_env(:block_scout_web, :other_explorers, [])

@ -711,8 +711,8 @@ msgid "Responses"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:107 #: lib/block_scout_web/templates/layout/_topnav.html.eex:111
#: lib/block_scout_web/templates/layout/_topnav.html.eex:125 #: lib/block_scout_web/templates/layout/_topnav.html.eex:129
msgid "Search" msgid "Search"
msgstr "" msgstr ""
@ -1653,8 +1653,8 @@ msgid "Error: Could not determine contract creator."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:101
#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 #: lib/block_scout_web/templates/layout/_topnav.html.eex:105
#: lib/block_scout_web/templates/layout/_topnav.html.eex:109
msgid "Search by address, token symbol name, transaction hash, or block number" msgid "Search by address, token symbol name, transaction hash, or block number"
msgstr "" msgstr ""

@ -711,8 +711,8 @@ msgid "Responses"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:107 #: lib/block_scout_web/templates/layout/_topnav.html.eex:111
#: lib/block_scout_web/templates/layout/_topnav.html.eex:125 #: lib/block_scout_web/templates/layout/_topnav.html.eex:129
msgid "Search" msgid "Search"
msgstr "" msgstr ""
@ -1653,8 +1653,8 @@ msgid "Error: Could not determine contract creator."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:101
#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 #: lib/block_scout_web/templates/layout/_topnav.html.eex:105
#: lib/block_scout_web/templates/layout/_topnav.html.eex:109
msgid "Search by address, token symbol name, transaction hash, or block number" msgid "Search by address, token symbol name, transaction hash, or block number"
msgstr "" msgstr ""

@ -41,16 +41,6 @@ defmodule EthereumJSONRPC.Encoder do
{id, {:error, "(#{code}) #{message}"}} {id, {:error, "(#{code}) #{message}"}}
end end
def decode_result(result, %{returns: r} = fs) when r in [:string, [:string]] do
case decode_result(result, %{fs | returns: {:tuple, [:string]}}) do
{id, {:ok, [{string}]}} ->
{id, {:ok, [string]}}
error ->
error
end
end
def decode_result(%{id: id, result: result}, function_selector) do def decode_result(%{id: id, result: result}, function_selector) do
types_list = List.wrap(function_selector.returns) types_list = List.wrap(function_selector.returns)

@ -84,7 +84,7 @@ defmodule EthereumJsonrpc.MixProject do
# Convert unix timestamps in JSONRPC to DateTimes # Convert unix timestamps in JSONRPC to DateTimes
{:timex, "~> 3.4"}, {:timex, "~> 3.4"},
# Encode/decode function names and arguments # Encode/decode function names and arguments
{:ex_abi, "~> 0.2.0"}, {:ex_abi, "~> 0.1.18"},
# `:verify_fun` for `Socket.Web.connect` # `:verify_fun` for `Socket.Web.connect`
{:ssl_verify_fun, "~> 1.1"}, {:ssl_verify_fun, "~> 1.1"},
# `EthereumJSONRPC.WebSocket` # `EthereumJSONRPC.WebSocket`

@ -5,7 +5,7 @@ defmodule Explorer.Etherscan.Logs do
""" """
import Ecto.Query, only: [from: 2, where: 3] import Ecto.Query, only: [from: 2, where: 3, subquery: 1, order_by: 3, limit: 2]
alias Explorer.Chain.Log alias Explorer.Chain.Log
alias Explorer.Repo alias Explorer.Repo
@ -77,8 +77,6 @@ defmodule Explorer.Etherscan.Logs do
inner_join: b in assoc(t, :block), inner_join: b in assoc(t, :block),
where: b.number >= ^prepared_filter.from_block, where: b.number >= ^prepared_filter.from_block,
where: b.number <= ^prepared_filter.to_block, where: b.number <= ^prepared_filter.to_block,
order_by: b.number,
limit: 1_000,
select: select:
merge(map(l, ^@log_fields), %{ merge(map(l, ^@log_fields), %{
gas_price: t.gas_price, gas_price: t.gas_price,
@ -90,8 +88,11 @@ defmodule Explorer.Etherscan.Logs do
) )
query query
|> subquery()
|> where_address_match(prepared_filter) |> where_address_match(prepared_filter)
|> where_topic_match(prepared_filter) |> where_topic_match(prepared_filter)
|> order_by([l], l.block_number)
|> limit(1_000)
|> Repo.all() |> Repo.all()
end end

@ -12,7 +12,7 @@ var evmVersion = process.argv[8];
var compiled_code = solc.loadRemoteVersion(version, function (err, solcSnapshot) { var compiled_code = solc.loadRemoteVersion(version, function (err, solcSnapshot) {
if (err) { if (err) {
console.log(JSON.stringify(err)); console.log(JSON.stringify(err.message));
} else { } else {
const input = { const input = {
language: 'Solidity', language: 'Solidity',

@ -72,7 +72,7 @@ defmodule Explorer.Validator.MetadataRetrieverTest do
id: id, id: id,
jsonrpc: "2.0", jsonrpc: "2.0",
result: result:
"0x00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001" "0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000001"
} }
]} ]}
end end
@ -91,7 +91,7 @@ defmodule Explorer.Validator.MetadataRetrieverTest do
id: id, id: id,
jsonrpc: "2.0", jsonrpc: "2.0",
result: result:
"0x546573746e616d65000000000000000000000000000000000000000000000000556e69746172696f6e000000000000000000000000000000000000000000000030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000585800000000000000000000000000000000000000000000000000000000000030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003afe130e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058585858585858207374726565742058585858585800000000000000000000000000000000000000000000000000000000000000000000000000000000000000" "0x546573746e616d65000000000000000000000000000000000000000000000000556e69746172696f6e000000000000000000000000000000000000000000000030303030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000140585800000000000000000000000000000000000000000000000000000000000030303030300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003afe130e000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000058585858585858207374726565742058585858585800000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
} }
]} ]}
end end

Loading…
Cancel
Save