Merge branch 'master' into ab-update-mix-lock

pull/2457/head
Ayrat Badykov 5 years ago committed by GitHub
commit 2ca027ada7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CHANGELOG.md
  2. 6
      apps/block_scout_web/lib/block_scout_web/controllers/address_coin_balance_controller.ex
  3. 25
      apps/block_scout_web/lib/block_scout_web/controllers/address_transaction_controller.ex
  4. 8
      apps/block_scout_web/lib/block_scout_web/templates/address/overview.html.eex
  5. 16
      apps/block_scout_web/priv/gettext/default.pot
  6. 16
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  7. 12
      apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs
  8. 10
      rel/commands/clear_build.sh

@ -3,8 +3,10 @@
### Features ### Features
### Fixes ### 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 ### 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 - [#2434](https://github.com/poanetwork/blockscout/pull/2434) - get rid of timex warnings

@ -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">

@ -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 ""
@ -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 ""
@ -1379,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 ""
@ -1425,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 ""

@ -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 ""
@ -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 ""
@ -1380,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 ""
@ -1426,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 ""

@ -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

@ -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