Merge branch 'transaction-history' of https://github.com/SlightlyCyborg/blockscout into transaction-history

pull/2404/head
slightlycyborg 5 years ago
commit c2f505696c
  1. 3
      CHANGELOG.md
  2. 2
      apps/block_scout_web/assets/js/lib/history_chart.js
  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. 2
      apps/block_scout_web/mix.exs
  7. 16
      apps/block_scout_web/priv/gettext/default.pot
  8. 16
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po
  9. 12
      apps/block_scout_web/test/block_scout_web/controllers/address_transaction_controller_test.exs
  10. 2
      apps/ethereum_jsonrpc/mix.exs
  11. 2
      apps/explorer/mix.exs
  12. 10
      rel/commands/clear_build.sh

@ -3,8 +3,11 @@
### 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

@ -55,7 +55,7 @@ const config = {
}
}, {
id: 'numTransactions',
position: "right",
position: 'right',
gridLines: {
display: false,
drawBorder: false

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

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

@ -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"
@ -989,7 +989,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 ""
@ -1386,7 +1386,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 ""
@ -1432,7 +1432,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"
@ -989,7 +989,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 ""
@ -1387,7 +1387,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 ""
@ -1433,7 +1433,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

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

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

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