Merge branch 'master' into exchange-rate-disable

pull/1855/head
saneery 6 years ago
commit 4210ec6154
  1. 4
      apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex
  2. 7
      apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex
  3. 14
      apps/block_scout_web/priv/gettext/default.pot
  4. 14
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  5. 10
      apps/ethereum_jsonrpc/lib/ethereum_jsonrpc/encoder.ex
  6. 2
      apps/ethereum_jsonrpc/mix.exs
  7. 4
      apps/explorer/test/explorer/validator/metadata_retriever_test.exs

@ -10,8 +10,8 @@
<p class="address-current-balance"> <p class="address-current-balance">
<span <span
data-wei-value="<%= if @address.fetched_coin_balance, do: @address.fetched_coin_balance.value %>" data-wei-value="<%= if @address.fetched_coin_balance, do: @address.fetched_coin_balance.value %>"
data-usd-exchange-rate="<%= @exchange_rate.usd_value %>" data-usd-exchange-rate="<%= @exchange_rate.usd_value %>">
></span> </span>
<small>(@ <span data-usd-unit-price="<%= @exchange_rate.usd_value %>"></span>/<%= gettext("Ether") %>)</small> <small>(@ <span data-usd-unit-price="<%= @exchange_rate.usd_value %>"></span>/<%= gettext("Ether") %>)</small>
</p> </p>
<% end %> <% end %>

@ -209,7 +209,12 @@
<h3 class="address-balance-text"> <h3 class="address-balance-text">
<%= value(@transaction) %> <%= value(@transaction) %>
</h3> </h3>
<p class="address-current-balance" data-wei-value=<%= @transaction.value.value %> data-usd-exchange-rate=<%= @exchange_rate.usd_value %>></p> <%= if !empty_exchange_rate?(@exchange_rate) do %>
<p class="address-current-balance"
data-wei-value=<%= @transaction.value.value %>
data-usd-exchange-rate=<%= @exchange_rate.usd_value %>>
</p>
<% end %>
</div> </div>
</div> </div>
</div> </div>

@ -426,11 +426,6 @@ msgstr ""
msgid "GET" msgid "GET"
msgstr "" msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:220
msgid "Gas"
msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:54 #: lib/block_scout_web/templates/block/_tile.html.eex:54
#: lib/block_scout_web/templates/block/overview.html.eex:103 #: lib/block_scout_web/templates/block/overview.html.eex:103
@ -505,7 +500,7 @@ msgid "Less than"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:230 #: lib/block_scout_web/templates/transaction/overview.html.eex:235
msgid "Limit" msgid "Limit"
msgstr "" msgstr ""
@ -974,7 +969,7 @@ msgid "Unique Token"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:224 #: lib/block_scout_web/templates/transaction/overview.html.eex:229
msgid "Used" msgid "Used"
msgstr "" msgstr ""
@ -1732,3 +1727,8 @@ msgstr ""
#: lib/block_scout_web/templates/chain/show.html.eex:107 #: lib/block_scout_web/templates/chain/show.html.eex:107
msgid "View All Transactions" msgid "View All Transactions"
msgstr "" msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:225
msgid "Gas"
msgstr ""

@ -426,11 +426,6 @@ msgstr ""
msgid "GET" msgid "GET"
msgstr "" msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:220
msgid "Gas"
msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/block/_tile.html.eex:54 #: lib/block_scout_web/templates/block/_tile.html.eex:54
#: lib/block_scout_web/templates/block/overview.html.eex:103 #: lib/block_scout_web/templates/block/overview.html.eex:103
@ -505,7 +500,7 @@ msgid "Less than"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:230 #: lib/block_scout_web/templates/transaction/overview.html.eex:235
msgid "Limit" msgid "Limit"
msgstr "" msgstr ""
@ -974,7 +969,7 @@ msgid "Unique Token"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:224 #: lib/block_scout_web/templates/transaction/overview.html.eex:229
msgid "Used" msgid "Used"
msgstr "" msgstr ""
@ -1732,3 +1727,8 @@ msgstr ""
#: lib/block_scout_web/templates/chain/show.html.eex:107 #: lib/block_scout_web/templates/chain/show.html.eex:107
msgid "View All Transactions" msgid "View All Transactions"
msgstr "" msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/transaction/overview.html.eex:225
msgid "Gas"
msgstr ""

@ -41,6 +41,16 @@ 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.1.18"}, {:ex_abi, "~> 0.2.0"},
# `: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`

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

Loading…
Cancel
Save