Merge pull request #3124 from poanetwork/vb-upper-border-tx-speed-display

Display upper border for tx speed if the value cannot be calculated
pull/3126/head
Victor Baranov 5 years ago committed by GitHub
commit 95c5856347
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 13
      apps/block_scout_web/lib/block_scout_web/views/transaction_view.ex
  3. 40
      apps/block_scout_web/priv/gettext/default.pot
  4. 40
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -13,6 +13,7 @@
- [#3106](https://github.com/poanetwork/blockscout/pull/3106), [#3115](https://github.com/poanetwork/blockscout/pull/3115) - Fix verification of contracts, created from factory (from internal transaction) - [#3106](https://github.com/poanetwork/blockscout/pull/3106), [#3115](https://github.com/poanetwork/blockscout/pull/3115) - Fix verification of contracts, created from factory (from internal transaction)
### Chore ### Chore
- [#3124](https://github.com/poanetwork/blockscout/pull/3124) - Display upper border for tx speed if the value cannot be calculated
## 3.1.2-beta ## 3.1.2-beta

@ -6,6 +6,7 @@ defmodule BlockScoutWeb.TransactionView do
alias Explorer.{Chain, Repo} alias Explorer.{Chain, Repo}
alias Explorer.Chain.Block.Reward alias Explorer.Chain.Block.Reward
alias Explorer.Chain.{Address, Block, InternalTransaction, Transaction, Wei} alias Explorer.Chain.{Address, Block, InternalTransaction, Transaction, Wei}
alias Explorer.Counters.AverageBlockTime
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias Timex.Duration alias Timex.Duration
@ -144,7 +145,17 @@ defmodule BlockScoutWeb.TransactionView do
end end
def processing_time_duration(%Transaction{earliest_processing_start: nil}) do def processing_time_duration(%Transaction{earliest_processing_start: nil}) do
:unknown avg_time = AverageBlockTime.average_block_time()
if avg_time == {:error, :disabled} do
:unknown
else
avg_time_in_secs =
avg_time
|> Duration.to_seconds()
{:ok, "<= #{avg_time_in_secs} seconds"}
end
end end
def processing_time_duration(%Transaction{ def processing_time_duration(%Transaction{

@ -59,7 +59,7 @@ msgid "%{subnetwork} Explorer - BlockScout"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:236 #: lib/block_scout_web/views/transaction_view.ex:247
msgid "(Awaiting internal transactions for status)" msgid "(Awaiting internal transactions for status)"
msgstr "" msgstr ""
@ -218,7 +218,7 @@ msgid "Block Number"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:32 #: lib/block_scout_web/views/transaction_view.ex:33
msgid "Block Pending" msgid "Block Pending"
msgstr "" msgstr ""
@ -355,12 +355,12 @@ msgid "Contract Byte Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:325 #: lib/block_scout_web/views/transaction_view.ex:336
msgid "Contract Call" msgid "Contract Call"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:322 #: lib/block_scout_web/views/transaction_view.ex:333
msgid "Contract Creation" msgid "Contract Creation"
msgstr "" msgstr ""
@ -558,12 +558,12 @@ msgid "During times when the network is busy (i.e during ICOs) it can take a whi
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:136 #: lib/block_scout_web/views/transaction_view.ex:137
msgid "ERC-20 " msgid "ERC-20 "
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:137 #: lib/block_scout_web/views/transaction_view.ex:138
msgid "ERC-721 " msgid "ERC-721 "
msgstr "" msgstr ""
@ -621,12 +621,12 @@ msgid "Error trying to fetch balances."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:240 #: lib/block_scout_web/views/transaction_view.ex:251
msgid "Error: %{reason}" msgid "Error: %{reason}"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:238 #: lib/block_scout_web/views/transaction_view.ex:249
msgid "Error: (Awaiting internal transactions for reason)" msgid "Error: (Awaiting internal transactions for reason)"
msgstr "" msgstr ""
@ -776,7 +776,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8
#: lib/block_scout_web/views/transaction_view.ex:237 #: lib/block_scout_web/views/transaction_view.ex:248
msgid "Success" msgid "Success"
msgstr "" msgstr ""
@ -891,7 +891,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:12 #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:12
#: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:10 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:10
#: lib/block_scout_web/views/transaction_view.ex:318 #: lib/block_scout_web/views/transaction_view.ex:329
msgid "Token Transfer" msgid "Token Transfer"
msgstr "" msgstr ""
@ -906,7 +906,7 @@ msgstr ""
#: lib/block_scout_web/views/address_view.ex:325 #: lib/block_scout_web/views/address_view.ex:325
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:90 #: lib/block_scout_web/views/tokens/instance/overview_view.ex:90
#: lib/block_scout_web/views/tokens/overview_view.ex:35 #: lib/block_scout_web/views/tokens/overview_view.ex:35
#: lib/block_scout_web/views/transaction_view.ex:379 #: lib/block_scout_web/views/transaction_view.ex:390
msgid "Token Transfers" msgid "Token Transfers"
msgstr "" msgstr ""
@ -922,7 +922,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:18 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:18
#: lib/block_scout_web/views/transaction_view.ex:328 #: lib/block_scout_web/views/transaction_view.ex:339
msgid "Transaction" msgid "Transaction"
msgstr "" msgstr ""
@ -1046,7 +1046,7 @@ msgid "Market Cap"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:221 #: lib/block_scout_web/views/transaction_view.ex:232
msgid "Max of" msgid "Max of"
msgstr "" msgstr ""
@ -1159,8 +1159,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:59 #: lib/block_scout_web/templates/layout/_topnav.html.eex:59
#: lib/block_scout_web/views/transaction_view.ex:235 #: lib/block_scout_web/views/transaction_view.ex:246
#: lib/block_scout_web/views/transaction_view.ex:269 #: lib/block_scout_web/views/transaction_view.ex:280
msgid "Pending" msgid "Pending"
msgstr "" msgstr ""
@ -1208,7 +1208,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24
#: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7
#: lib/block_scout_web/views/transaction_view.ex:382 #: lib/block_scout_web/views/transaction_view.ex:393
msgid "Raw Trace" msgid "Raw Trace"
msgstr "" msgstr ""
@ -1838,7 +1838,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6
#: lib/block_scout_web/views/address_view.ex:324 #: lib/block_scout_web/views/address_view.ex:324
#: lib/block_scout_web/views/transaction_view.ex:380 #: lib/block_scout_web/views/transaction_view.ex:391
msgid "Internal Transactions" msgid "Internal Transactions"
msgstr "" msgstr ""
@ -1848,7 +1848,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8
#: lib/block_scout_web/views/address_view.ex:331 #: lib/block_scout_web/views/address_view.ex:331
#: lib/block_scout_web/views/transaction_view.ex:381 #: lib/block_scout_web/views/transaction_view.ex:392
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
@ -1888,7 +1888,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:8 #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:8
#: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:6 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:6
#: lib/block_scout_web/views/transaction_view.ex:317 #: lib/block_scout_web/views/transaction_view.ex:328
msgid "Token Burning" msgid "Token Burning"
msgstr "" msgstr ""
@ -1900,7 +1900,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:10 #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:10
#: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:8 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:8
#: lib/block_scout_web/views/transaction_view.ex:316 #: lib/block_scout_web/views/transaction_view.ex:327
msgid "Token Minting" msgid "Token Minting"
msgstr "" msgstr ""

@ -59,7 +59,7 @@ msgid "%{subnetwork} Explorer - BlockScout"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:236 #: lib/block_scout_web/views/transaction_view.ex:247
msgid "(Awaiting internal transactions for status)" msgid "(Awaiting internal transactions for status)"
msgstr "" msgstr ""
@ -218,7 +218,7 @@ msgid "Block Number"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:32 #: lib/block_scout_web/views/transaction_view.ex:33
msgid "Block Pending" msgid "Block Pending"
msgstr "" msgstr ""
@ -355,12 +355,12 @@ msgid "Contract Byte Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:325 #: lib/block_scout_web/views/transaction_view.ex:336
msgid "Contract Call" msgid "Contract Call"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:322 #: lib/block_scout_web/views/transaction_view.ex:333
msgid "Contract Creation" msgid "Contract Creation"
msgstr "" msgstr ""
@ -558,12 +558,12 @@ msgid "During times when the network is busy (i.e during ICOs) it can take a whi
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:136 #: lib/block_scout_web/views/transaction_view.ex:137
msgid "ERC-20 " msgid "ERC-20 "
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:137 #: lib/block_scout_web/views/transaction_view.ex:138
msgid "ERC-721 " msgid "ERC-721 "
msgstr "" msgstr ""
@ -621,12 +621,12 @@ msgid "Error trying to fetch balances."
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:240 #: lib/block_scout_web/views/transaction_view.ex:251
msgid "Error: %{reason}" msgid "Error: %{reason}"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:238 #: lib/block_scout_web/views/transaction_view.ex:249
msgid "Error: (Awaiting internal transactions for reason)" msgid "Error: (Awaiting internal transactions for reason)"
msgstr "" msgstr ""
@ -776,7 +776,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8 #: lib/block_scout_web/templates/transaction/_emission_reward_tile.html.eex:8
#: lib/block_scout_web/views/transaction_view.ex:237 #: lib/block_scout_web/views/transaction_view.ex:248
msgid "Success" msgid "Success"
msgstr "" msgstr ""
@ -891,7 +891,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:12 #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:12
#: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:10 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:10
#: lib/block_scout_web/views/transaction_view.ex:318 #: lib/block_scout_web/views/transaction_view.ex:329
msgid "Token Transfer" msgid "Token Transfer"
msgstr "" msgstr ""
@ -906,7 +906,7 @@ msgstr ""
#: lib/block_scout_web/views/address_view.ex:325 #: lib/block_scout_web/views/address_view.ex:325
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:90 #: lib/block_scout_web/views/tokens/instance/overview_view.ex:90
#: lib/block_scout_web/views/tokens/overview_view.ex:35 #: lib/block_scout_web/views/tokens/overview_view.ex:35
#: lib/block_scout_web/views/transaction_view.ex:379 #: lib/block_scout_web/views/transaction_view.ex:390
msgid "Token Transfers" msgid "Token Transfers"
msgstr "" msgstr ""
@ -922,7 +922,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address_logs/_logs.html.eex:18 #: lib/block_scout_web/templates/address_logs/_logs.html.eex:18
#: lib/block_scout_web/views/transaction_view.ex:328 #: lib/block_scout_web/views/transaction_view.ex:339
msgid "Transaction" msgid "Transaction"
msgstr "" msgstr ""
@ -1046,7 +1046,7 @@ msgid "Market Cap"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/transaction_view.ex:221 #: lib/block_scout_web/views/transaction_view.ex:232
msgid "Max of" msgid "Max of"
msgstr "" msgstr ""
@ -1159,8 +1159,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/layout/_topnav.html.eex:59 #: lib/block_scout_web/templates/layout/_topnav.html.eex:59
#: lib/block_scout_web/views/transaction_view.ex:235 #: lib/block_scout_web/views/transaction_view.ex:246
#: lib/block_scout_web/views/transaction_view.ex:269 #: lib/block_scout_web/views/transaction_view.ex:280
msgid "Pending" msgid "Pending"
msgstr "" msgstr ""
@ -1208,7 +1208,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:24 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:24
#: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7 #: lib/block_scout_web/templates/transaction_raw_trace/index.html.eex:7
#: lib/block_scout_web/views/transaction_view.ex:382 #: lib/block_scout_web/views/transaction_view.ex:393
msgid "Raw Trace" msgid "Raw Trace"
msgstr "" msgstr ""
@ -1838,7 +1838,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6
#: lib/block_scout_web/views/address_view.ex:324 #: lib/block_scout_web/views/address_view.ex:324
#: lib/block_scout_web/views/transaction_view.ex:380 #: lib/block_scout_web/views/transaction_view.ex:391
msgid "Internal Transactions" msgid "Internal Transactions"
msgstr "" msgstr ""
@ -1848,7 +1848,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8
#: lib/block_scout_web/views/address_view.ex:331 #: lib/block_scout_web/views/address_view.ex:331
#: lib/block_scout_web/views/transaction_view.ex:381 #: lib/block_scout_web/views/transaction_view.ex:392
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
@ -1888,7 +1888,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:8 #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:8
#: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:6 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:6
#: lib/block_scout_web/views/transaction_view.ex:317 #: lib/block_scout_web/views/transaction_view.ex:328
msgid "Token Burning" msgid "Token Burning"
msgstr "" msgstr ""
@ -1900,7 +1900,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:10 #: lib/block_scout_web/templates/tokens/transfer/_token_transfer.html.eex:10
#: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:8 #: lib/block_scout_web/templates/transaction_token_transfer/_token_transfer.html.eex:8
#: lib/block_scout_web/views/transaction_view.ex:316 #: lib/block_scout_web/views/transaction_view.ex:327
msgid "Token Minting" msgid "Token Minting"
msgstr "" msgstr ""

Loading…
Cancel
Save