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

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

@ -83,7 +83,11 @@ defmodule BlockScoutWeb.AddressTransactionController do
unprocessable_entity(conn)
{: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
@ -106,7 +110,24 @@ defmodule BlockScoutWeb.AddressTransactionController do
unprocessable_entity(conn)
{: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

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

@ -190,7 +190,7 @@ msgstr ""
#, elixir-format
#: 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/views/address_view.ex:311
msgid "Blocks Validated"
@ -209,8 +209,8 @@ msgstr ""
#, elixir-format
#: 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:152
#: lib/block_scout_web/templates/address/overview.html.eex:146
#: 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:115
msgid "Close"
@ -319,7 +319,7 @@ msgid "Copy Txn Hash"
msgstr ""
#, 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"
msgstr ""
@ -621,7 +621,7 @@ msgstr ""
#, elixir-format
#: 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:106
msgid "QR Code"
@ -983,7 +983,7 @@ msgid "Yes"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:111
#: lib/block_scout_web/templates/address/overview.html.eex:113
msgid "at"
msgstr ""
@ -1379,7 +1379,7 @@ msgid "Contract Libraries"
msgstr ""
#, 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 #"
msgstr ""
@ -1425,7 +1425,7 @@ msgid "Incoming Transactions"
msgstr ""
#, 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."
msgstr ""

@ -190,7 +190,7 @@ msgstr ""
#, elixir-format
#: 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/views/address_view.ex:311
msgid "Blocks Validated"
@ -209,8 +209,8 @@ msgstr ""
#, elixir-format
#: 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:152
#: lib/block_scout_web/templates/address/overview.html.eex:146
#: 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:115
msgid "Close"
@ -319,7 +319,7 @@ msgid "Copy Txn Hash"
msgstr ""
#, 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"
msgstr ""
@ -621,7 +621,7 @@ msgstr ""
#, elixir-format
#: 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:106
msgid "QR Code"
@ -983,7 +983,7 @@ msgid "Yes"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/overview.html.eex:111
#: lib/block_scout_web/templates/address/overview.html.eex:113
msgid "at"
msgstr ""
@ -1380,7 +1380,7 @@ msgid "Contract Libraries"
msgstr ""
#, 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 #"
msgstr ""
@ -1426,7 +1426,7 @@ msgid "Incoming Transactions"
msgstr ""
#, 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."
msgstr ""

@ -13,10 +13,16 @@ defmodule BlockScoutWeb.AddressTransactionControllerTest do
assert html_response(conn, 422)
end
test "with valid address hash without address", %{conn: conn} do
conn = get(conn, address_transaction_path(conn, :index, "0x8bf38d4764929064f2d4d3a56520a76ab3df415b"))
test "with valid address hash without address in the DB", %{conn: conn} do
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
test "returns transactions for the address", %{conn: conn} do

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

Loading…
Cancel
Save