Move unit conversions into Explorer.Chain

pull/128/head
Luke Imhoff 7 years ago
parent 4fcace87b0
commit 31c06221a3
  1. 27
      .circleci/config.yml
  2. 2
      .credo.exs
  3. 27
      apps/explorer/lib/explorer/chain.ex
  4. 13
      apps/explorer/lib/explorer/chain/block.ex
  5. 10
      apps/explorer/lib/explorer/chain/gas.ex
  6. 44
      apps/explorer/lib/explorer/chain/internal_transaction.ex
  7. 143
      apps/explorer/lib/explorer/chain/transaction.ex
  8. 105
      apps/explorer/lib/explorer/chain/wei.ex
  9. 5
      apps/explorer/test/explorer/chain/wei_test.exs
  10. 56
      apps/explorer/test/explorer/chain_test.exs
  11. 13
      apps/explorer_web/README.md
  12. 9
      apps/explorer_web/lib/explorer_web/controllers/transaction_log_controller.ex
  13. 20
      apps/explorer_web/lib/explorer_web/helpers/wei_converter.ex
  14. 2
      apps/explorer_web/lib/explorer_web/templates/address/show.html.eex
  15. 2
      apps/explorer_web/lib/explorer_web/templates/address_transaction_from/index.html.eex
  16. 2
      apps/explorer_web/lib/explorer_web/templates/address_transaction_to/index.html.eex
  17. 4
      apps/explorer_web/lib/explorer_web/templates/block/index.html.eex
  18. 2
      apps/explorer_web/lib/explorer_web/templates/block_transaction/index.html.eex
  19. 2
      apps/explorer_web/lib/explorer_web/templates/chain/show.html.eex
  20. 2
      apps/explorer_web/lib/explorer_web/templates/pending_transaction/index.html.eex
  21. 2
      apps/explorer_web/lib/explorer_web/templates/transaction/index.html.eex
  22. 8
      apps/explorer_web/lib/explorer_web/templates/transaction/overview.html.eex
  23. 8
      apps/explorer_web/lib/explorer_web/templates/transaction/show.html.eex
  24. 5
      apps/explorer_web/lib/explorer_web/views/address_transaction_from_view.ex
  25. 5
      apps/explorer_web/lib/explorer_web/views/address_transaction_to_view.ex
  26. 6
      apps/explorer_web/lib/explorer_web/views/block_transaction_view.ex
  27. 5
      apps/explorer_web/lib/explorer_web/views/chain_view.ex
  28. 6
      apps/explorer_web/lib/explorer_web/views/pending_transaction_view.ex
  29. 18
      apps/explorer_web/lib/explorer_web/views/transaction_view.ex
  30. 164
      apps/explorer_web/priv/gettext/default.pot
  31. 164
      apps/explorer_web/priv/gettext/en/LC_MESSAGES/default.po
  32. 4
      apps/explorer_web/test/explorer_web/controllers/transaction_controller_test.exs
  33. 17
      apps/explorer_web/test/explorer_web/features/contributor_browsing_test.exs
  34. 19
      apps/explorer_web/test/explorer_web/helpers/wei_converter_test.exs

@ -259,6 +259,30 @@ jobs:
- store_test_results: - store_test_results:
path: apps/explorer_web/assets/test path: apps/explorer_web/assets/test
gettext:
docker:
# Ensure .tool-versions matches
- image: circleci/elixir:1.6.4
environment:
MIX_ENV: test
working_directory: ~/app
steps:
- attach_workspace:
at: .
- run: mix local.hex --force
- run:
name: Check for missed translations
command: |
mix gettext.extract --merge | tee stdout.txt
! grep "Wrote " stdout.txt
working_directory: "apps/explorer_web"
- store_artifacts:
path: apps/explorer_web/priv/gettext
sobelow: sobelow:
docker: docker:
# Ensure .tool-versions matches # Ensure .tool-versions matches
@ -361,6 +385,9 @@ workflows:
- eslint: - eslint:
requires: requires:
- build - build
- gettext:
requires:
- build
- sobelow: - sobelow:
requires: requires:
- build - build

@ -63,7 +63,7 @@
# You can customize the priority of any check # You can customize the priority of any check
# Priority values are: `low, normal, high, higher` # Priority values are: `low, normal, high, higher`
# #
{Credo.Check.Design.AliasUsage, priority: :low}, {Credo.Check.Design.AliasUsage, excluded_lastnames: ~w(Number Time), priority: :low},
# For some checks, you can also set other parameters # For some checks, you can also set other parameters
# #

@ -12,7 +12,8 @@ defmodule Explorer.Chain do
InternalTransaction, InternalTransaction,
Log, Log,
Receipt, Receipt,
Transaction Transaction,
Wei
} }
alias Explorer.Repo.NewRelic, as: Repo alias Explorer.Repo.NewRelic, as: Repo
@ -171,6 +172,16 @@ defmodule Explorer.Chain do
address_to_transactions(address, Keyword.put(options, :direction, :from)) address_to_transactions(address, Keyword.put(options, :direction, :from))
end end
@doc """
The `t:Explorer.Chain.Transaction.t/0` `gas_price` of the `transaction` in `unit`.
"""
@spec gas_price(Transaction.t(), :wei) :: Wei.t()
@spec gas_price(Transaction.t(), :gwei) :: Wei.gwei()
@spec gas_price(Transaction.t(), :ether) :: Wei.ether()
def gas_price(%Transaction{gas_price: gas_price}, unit) do
Wei.to(gas_price, unit)
end
@doc """ @doc """
Converts `t:Explorer.Chain.Address.t/0` `hash` to the `t:Explorer.Chain.Address.t/0` with that `hash`. Converts `t:Explorer.Chain.Address.t/0` `hash` to the `t:Explorer.Chain.Address.t/0` with that `hash`.
@ -470,6 +481,20 @@ defmodule Explorer.Chain do
end end
end end
@doc """
The `t:Explorer.Chain.Transaction.t/0` or `t:Explorer.Chain.InternalTransaction.t/0` `value` of the `transaction` in
`unit`.
"""
@spec value(InternalTransaction.t(), :wei) :: Wei.t()
@spec value(InternalTransaction.t(), :gwei) :: Wei.gwei()
@spec value(InternalTransaction.t(), :ether) :: Wei.ether()
@spec value(Transaction.t(), :wei) :: Wei.t()
@spec value(Transaction.t(), :gwei) :: Wei.gwei()
@spec value(Transaction.t(), :ether) :: Wei.ether()
def value(%type{value: value}, unit) when type in [InternalTransaction, Transaction] do
Wei.to(value, unit)
end
## Private Functions ## Private Functions
defp address_id_to_transactions(address_id, named_arguments) defp address_id_to_transactions(address_id, named_arguments)

@ -7,7 +7,7 @@ defmodule Explorer.Chain.Block do
use Explorer.Schema use Explorer.Schema
alias Explorer.Chain.{BlockTransaction, Hash, Transaction} alias Explorer.Chain.{BlockTransaction, Gas, Hash, Transaction}
# Types # Types
@ -18,13 +18,6 @@ defmodule Explorer.Chain.Block do
""" """
@type difficulty :: Decimal.t() @type difficulty :: Decimal.t()
@typedoc """
A measurement roughly equivalent to computational steps. Every operation has a gas expenditure; for most operations
it is ~3-10, although some expensive operations have expenditures up to 700 and a transaction itself has an
expenditure of 21000.
"""
@type gas :: non_neg_integer()
@typedoc """ @typedoc """
Number of the block in the chain. Number of the block in the chain.
""" """
@ -52,8 +45,8 @@ defmodule Explorer.Chain.Block do
@type t :: %__MODULE__{ @type t :: %__MODULE__{
block_transactions: %Ecto.Association.NotLoaded{} | [BlockTransaction.t()], block_transactions: %Ecto.Association.NotLoaded{} | [BlockTransaction.t()],
difficulty: difficulty(), difficulty: difficulty(),
gas_limit: gas(), gas_limit: Gas.t(),
gas_used: gas(), gas_used: Gas.t(),
hash: Hash.t(), hash: Hash.t(),
miner: Address.hash(), miner: Address.hash(),
nonce: Hash.t(), nonce: Hash.t(),

@ -0,0 +1,10 @@
defmodule Explorer.Chain.Gas do
@moduledoc """
A measurement roughly equivalent to computational steps. Every operation has a gas expenditure; for most operations
it is ~3-10, although some expensive operations have expenditures up to 700 and a transaction itself has an
expenditure of 21000.
"""
@typedoc @moduledoc
@type t :: non_neg_integer()
end

@ -3,7 +3,49 @@ defmodule Explorer.Chain.InternalTransaction do
use Explorer.Schema use Explorer.Schema
alias Explorer.Chain.{Address, Transaction} alias Explorer.Chain.{Address, Gas, Transaction, Wei}
@typedoc """
* `"call"`
* `"callcode"`
* `"delegatecall"`
* `"none"`
* `"staticcall"
"""
@type call_type :: String.t()
@typedoc """
* `call_type` - the type of call
* `from_address` - the source of the `value`
* `from_address_id` - foreign key for `from_address`
* `gas` - the amount of gas allowed
* `gas_used` - the amount of gas used
* `index` - the index of this internal transaction inside the `transaction`
* `input` - input bytes to the call
* `output` - output bytes from the call
* `to_address` - the sink of the `value`
* `to_address_id` - foreign key for `to_address`
* `trace_address` - list of traces
* `transaction` - transaction in which this transaction occured
* `transaction_id` - foreign key for `transaction`
* `value` - value of transfered from `from_address` to `to_address`
"""
@type t :: %__MODULE__{
call_type: call_type,
from_address: %Ecto.Association.NotLoaded{} | Address.t(),
from_address_id: non_neg_integer(),
gas: Gas.t(),
gas_used: Gas.t(),
index: non_neg_integer(),
input: String.t(),
output: String.t(),
to_address: %Ecto.Association.NotLoaded{} | Address.t(),
to_address_id: non_neg_integer(),
trace_address: [non_neg_integer()],
transaction: %Ecto.Association.NotLoaded{} | Transaction.t(),
transaction_id: non_neg_integer(),
value: Wei.t()
}
schema "internal_transactions" do schema "internal_transactions" do
field(:call_type, :string) field(:call_type, :string)

@ -3,19 +3,130 @@ defmodule Explorer.Chain.Transaction do
use Explorer.Schema use Explorer.Schema
alias Explorer.Chain.{Address, BlockTransaction, InternalTransaction, Receipt} alias Explorer.Chain.{Address, Block, BlockTransaction, Hash, InternalTransaction, Receipt, Wei}
# Constants
@required_attrs ~w(hash value gas gas_price input nonce public_key r s
standard_v transaction_index v)a
@optional_attrs ~w(to_address_id from_address_id)a
# Types
@typedoc """
The full public key of the signer of the transaction.
"""
@type public_key :: String.t()
@typedoc """
X coordinate module n in
[Elliptic Curve Digital Signature Algorithm](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm)
(EDCSA)
"""
@type r :: String.t()
@typedoc """
Y coordinate module n in
[Elliptic Curve Digital Signature Algorithm](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm)
(EDCSA)
"""
@type s :: String.t()
@typedoc """
For message signatures, we use a trick called public key recovery. The fact is that if you have the full R point
(not just its X coordinate) and `t:s/0`, and a message, you can compute for which public key this would be a valid
signature. What this allows is to 'verify' a message with an address, without needing to know the full key (we just to
public key recovery on the signature, and then hash the recovered key and compare it with the address).
However, this means we need the full R coordinates. There can be up to 4 different points with a given
"X coordinate modulo n". (2 because each X coordinate has two possible Y coordinates, and 2 because r+n may still be a
valid X coordinate). That number between 0 and 3 is standard_v.
| `standard_v` | X | Y |
|---------------|--------|------|
| `0` | lower | even |
| `1` | lower | odd |
| `2` | higher | even |
| `3` | higher | odd |
**Note: that `2` and `3` are exceedingly rarely, and will in practice only ever be seen in specifically generated
examples.**
"""
@type standard_v :: 0..3
@typedoc """
`t:standard_v/0` + `27`
| `v` | X | Y |
|------|--------|------|
| `27` | lower | even |
| `28` | lower | odd |
| `29` | higher | even |
| `30` | higher | odd |
**Note: that `29` and `30` are exceedingly rarely, and will in practice only ever be seen in specifically generated
examples.**
"""
@type v :: 27..30
@typedoc """
How much the sender is willing to pay in wei per unit of gas.
"""
@type wei_per_gas :: non_neg_integer()
@typedoc """
* `block_transaction` - joins this transaction to its `block`
* `block` - the block in which this transaction was mined/validated
* `from_address` - the source of `value`
* `from_address_id` - foreign key of `from_address`
* `gas` - Gas provided by the sender
* `gas_price` - How much the sender is willing to pay for `gas`
* `hash` - hash of contents of this transaction
* `input`- data sent along with the transaction
* `internal_transactions` - transactions (value transfers) created while executing contract used for this transaction
* `nonce` - the number of transaction made by the sender prior to this one
* `public_key` - public key of the signer of the transaction
* `r` - the R field of the signature. The (r, s) is the normal output of an ECDSA signature, where r is computed as
the X coordinate of a point R, modulo the curve order n.
* `s` - The S field of the signature. The (r, s) is the normal output of an ECDSA signature, where r is computed as
the X coordinate of a point R, modulo the curve order n.
* `standard_v` - The standardized V field of the signature
* `to_address` - sink of `value`
* `to_address_id` - `to_address` foreign key
* `transaction_index` - index of this transaction in `block`
* `v` - The V field of the signature.
* `value` - wei transferred from `from_address` to `to_address`
"""
@type t :: %__MODULE__{
block: %Ecto.Association.NotLoaded{} | Block.t(),
block_transaction: %Ecto.Association.NotLoaded{} | BlockTransaction.t(),
from_address: %Ecto.Association.NotLoaded{} | Address.t(),
from_address_id: non_neg_integer(),
gas: Gas.t(),
gas_price: wei_per_gas,
hash: Hash.t(),
input: String.t(),
internal_transactions: %Ecto.Association.NotLoaded{} | [InternalTransaction.t()],
nonce: non_neg_integer(),
public_key: public_key(),
r: r(),
receipt: %Ecto.Association.NotLoaded{} | Receipt.t(),
s: s(),
standard_v: standard_v(),
to_address: %Ecto.Association.NotLoaded{} | Address.t(),
to_address_id: non_neg_integer(),
transaction_index: non_neg_integer(),
v: v(),
value: Wei.t()
}
# Schema
schema "transactions" do schema "transactions" do
has_one(:receipt, Receipt)
has_one(:block_transaction, BlockTransaction)
has_one(:block, through: [:block_transaction, :block])
belongs_to(:from_address, Address)
belongs_to(:to_address, Address)
has_many(:internal_transactions, InternalTransaction)
field(:hash, :string)
field(:value, :decimal)
field(:gas, :decimal) field(:gas, :decimal)
field(:gas_price, :decimal) field(:gas_price, :decimal)
field(:hash, :string)
field(:input, :string) field(:input, :string)
field(:nonce, :integer) field(:nonce, :integer)
field(:public_key, :string) field(:public_key, :string)
@ -24,13 +135,17 @@ defmodule Explorer.Chain.Transaction do
field(:standard_v, :string) field(:standard_v, :string)
field(:transaction_index, :string) field(:transaction_index, :string)
field(:v, :string) field(:v, :string)
timestamps() field(:value, :decimal)
end
@required_attrs ~w(hash value gas gas_price input nonce public_key r s timestamps()
standard_v transaction_index v)a
@optional_attrs ~w(to_address_id from_address_id)a has_one(:block_transaction, BlockTransaction)
has_one(:block, through: [:block_transaction, :block])
belongs_to(:from_address, Address)
has_many(:internal_transactions, InternalTransaction)
has_one(:receipt, Receipt)
belongs_to(:to_address, Address)
end
@doc false @doc false
def changeset(%__MODULE__{} = transaction, attrs \\ %{}) do def changeset(%__MODULE__{} = transaction, attrs \\ %{}) do

@ -0,0 +1,105 @@
defmodule Explorer.Chain.Wei do
@moduledoc """
The smallest fractional unit of Ether. Using wei instead of ether allows code to do integer match instead of using
floats.
Etymology of "wei" comes from [Wei Dai ()](https://en.wikipedia.org/wiki/Wei_Dai), a
[cypherpunk](https://en.wikipedia.org/wiki/Cypherpunk) who came up with b-money, which outlined modern
cryptocurrencies.
"""
@typedoc """
Ether is the default unit Ethereum and its side chains are measured in when displaying values to humans.
10<sup>18</sup> wei is 1 ether.
"""
@type ether :: Decimal.t()
@typedoc """
Short for giga-wei
* 10<sup>9</sup> wei is one gwei
"""
@type gwei :: Decimal.t()
@typedoc """
The unit to convert `t:wei/0` to.
"""
@type unit :: :wei | :gwei | :ether
@typedoc @moduledoc
@type t :: Decimal.t()
# Constants
@wei_per_ether Decimal.new(1_000_000_000_000_000_000)
@wei_per_gwei Decimal.new(1_000_000_000)
## Functions
@doc """
Convert wei to itself.
iex> Explorer.Chain.Wei.from(Decimal.new(1), :wei)
Decimal.new(1)
Convert `t:gwei/0` to wei.
iex> Explorer.Chain.Wei.from(Decimal.new(1), :gwei)
Decimal.new(1_000_000_000)
Convert `t:ether/0` to wei.
iex> Explorer.Chain.Wei.from(Decimal.new(1), :ether)
Decimal.new(1_000_000_000_000_000_000)
"""
@spec from(ether(), :ether) :: t()
def from(ether, :ether) do
Decimal.mult(ether, @wei_per_ether)
end
@spec from(gwei(), :gwei) :: t()
def from(gwei, :gwei) do
Decimal.mult(gwei, @wei_per_gwei)
end
@spec from(t(), :wei) :: t()
def from(wei, :wei), do: wei
@doc """
Convert wei to itself.
iex> Explorer.Chain.Wei.to(Decimal.new(1), :wei)
Decimal.new(1)
Convert wei to `t:gwei/0`.
iex> Explorer.Chain.Wei.to(Decimal.new(1), :gwei)
Decimal.new("1e-9")
iex> Explorer.Chain.Wei.to(Decimal.new("1e9"), :gwei)
Decimal.new(1)
Convert wei to `t:ether/0`.
iex> Explorer.Chain.Wei.to(Decimal.new(1), :ether)
Decimal.new("1e-18")
iex> Explorer.Chain.Wei.to(Decimal.new("1e18"), :ether)
Decimal.new(1)
"""
@spec to(t(), :ether) :: ether()
def to(wei, :ether) do
Decimal.div(wei, @wei_per_ether)
end
@spec to(t(), :gwei) :: gwei()
def to(wei, :gwei) do
Decimal.div(wei, @wei_per_gwei)
end
@spec to(t(), :wei) :: t()
def to(wei, :wei), do: wei
end

@ -0,0 +1,5 @@
defmodule Explorer.Chain.WeiTest do
use ExUnit.Case, async: true
doctest Explorer.Chain.Wei
end

@ -182,6 +182,27 @@ defmodule Explorer.ChainTest do
end end
end end
describe "gas_price/2" do
test ":wei unit" do
assert Chain.gas_price(%Transaction{gas_price: Decimal.new(1)}, :wei) == Decimal.new(1)
end
test ":gwei unit" do
assert Chain.gas_price(%Transaction{gas_price: Decimal.new(1)}, :gwei) ==
Decimal.new("1e-9")
assert Chain.gas_price(%Transaction{gas_price: Decimal.new("1e9")}, :gwei) == Decimal.new(1)
end
test ":ether unit" do
assert Chain.gas_price(%Transaction{gas_price: Decimal.new(1)}, :ether) ==
Decimal.new("1e-18")
assert Chain.gas_price(%Transaction{gas_price: Decimal.new("1e18")}, :ether) ==
Decimal.new(1)
end
end
describe "from_address_to_transactions/2" do describe "from_address_to_transactions/2" do
test "without transactions" do test "without transactions" do
address = insert(:address) address = insert(:address)
@ -754,4 +775,39 @@ defmodule Explorer.ChainTest do
assert {:ok, %Address{balance: ^expected_balance}} = Chain.hash_to_address("0xtwizzlers") assert {:ok, %Address{balance: ^expected_balance}} = Chain.hash_to_address("0xtwizzlers")
end end
end end
describe "value/2" do
test "with InternalTransaction.t with :wei" do
assert Chain.value(%InternalTransaction{value: Decimal.new(1)}, :wei) == Decimal.new(1)
end
test "with InternalTransaction.t with :gwei" do
assert Chain.value(%InternalTransaction{value: Decimal.new(1)}, :gwei) ==
Decimal.new("1e-9")
assert Chain.value(%InternalTransaction{value: Decimal.new("1e9")}, :gwei) == Decimal.new(1)
end
test "with InternalTransaction.t with :ether" do
assert Chain.value(%InternalTransaction{value: Decimal.new(1)}, :ether) ==
Decimal.new("1e-18")
assert Chain.value(%InternalTransaction{value: Decimal.new("1e18")}, :ether) ==
Decimal.new(1)
end
test "with Transaction.t with :wei" do
assert Chain.value(%Transaction{value: Decimal.new(1)}, :wei) == Decimal.new(1)
end
test "with Transaction.t with :gwei" do
assert Chain.value(%Transaction{value: Decimal.new(1)}, :gwei) == Decimal.new("1e-9")
assert Chain.value(%Transaction{value: Decimal.new("1e9")}, :gwei) == Decimal.new(1)
end
test "with Transaction.t with :ether" do
assert Chain.value(%Transaction{value: Decimal.new(1)}, :ether) == Decimal.new("1e-18")
assert Chain.value(%Transaction{value: Decimal.new("1e18")}, :ether) == Decimal.new(1)
end
end
end end

@ -32,13 +32,14 @@ You can also run IEx (Interactive Elixir): `$ iex -S mix phx.server` (This can b
### Testing ### Testing
* Build the assets: `$ cd assets && npm run build` * Build the assets: `cd assets && npm run build`
* Format the Elixir code: `$ mix format` * Format the Elixir code: `mix format`
* Run the test suite with coverage: `$ mix coveralls.html` * Run the test suite with coverage: `mix coveralls.html`
* Lint the Elixir code: `$ mix credo --strict` * Lint the Elixir code: `mix credo --strict`
* Run the dialyzer: `mix dialyzer --halt-exit-status` * Run the dialyzer: `mix dialyzer --halt-exit-status`
* Check the Elixir code for vulnerabilities: `$ mix sobelow --config` * Check the Elixir code for vulnerabilities: `mix sobelow --config`
* Lint the JavaScript code: `$ cd assets && npm run eslint` * Update translations templates and translations and check there are no uncommitted changes: `mix gettext.extract --merge`
* Lint the JavaScript code: `cd assets && npm run eslint`
## Internationalization ## Internationalization

@ -20,9 +20,16 @@ defmodule ExplorerWeb.TransactionLogController do
necessity_by_association: %{address: :optional}, necessity_by_association: %{address: :optional},
pagination: params pagination: params
) )
max_block_number = Chain.max_block_number() max_block_number = Chain.max_block_number()
render(conn, "index.html", logs: logs, max_block_number: max_block_number, transaction: transaction) render(
conn,
"index.html",
logs: logs,
max_block_number: max_block_number,
transaction: transaction
)
{:error, :not_found} -> {:error, :not_found} ->
not_found(conn) not_found(conn)

@ -1,20 +0,0 @@
defmodule ExplorerWeb.WeiConverter do
@moduledoc """
Utility module for conversion of wei to other units
"""
@wei_per_ether 1_000_000_000_000_000_000
@wei_per_gwei 1_000_000_000
@spec to_ether(Decimal.t()) :: Decimal.t()
def to_ether(wei) do
wei
|> Decimal.div(Decimal.new(@wei_per_ether))
end
@spec to_gwei(Decimal.t()) :: Decimal.t()
def to_gwei(wei) do
wei
|> Decimal.div(Decimal.new(@wei_per_gwei))
end
end

@ -13,7 +13,7 @@
<dl> <dl>
<div class="address__item"> <div class="address__item">
<dt class="address__item-key"><%= gettext "Balance" %></dt> <dt class="address__item-key"><%= gettext "Balance" %></dt>
<dd class="address__item-value address__balance" title="<%= @address.hash %>"><%= format_balance(@address.balance) %> <%= gettext "POA" %></dd> <dd class="address__item-value address__balance" title="<%= @address.hash %>"><%= format_balance(@address.balance) %> <%= gettext "Ether" %></dd>
</div> </div>
</dl> </dl>
</div> </div>

@ -41,7 +41,7 @@
<td class="transactions__column transactions__column--to transactions__column--optional"> <td class="transactions__column transactions__column--to transactions__column--optional">
<div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div> <div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div>
</td> </td>
<td class="transactions__column transactions__column--value"><%= Decimal.div(Decimal.new(transaction.value), Decimal.new(1_000_000_000_000_000_000)) |> Decimal.to_string(:normal) %> <%= gettext "POA" %></td> <td class="transactions__column transactions__column--value"><%= value(transaction) %> <%= gettext "Ether" %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -41,7 +41,7 @@
<td class="transactions__column transactions__column--to transactions__column--optional"> <td class="transactions__column transactions__column--to transactions__column--optional">
<div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div> <div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div>
</td> </td>
<td class="transactions__column transactions__column--value"><%= Decimal.div(Decimal.new(transaction.value), Decimal.new(1_000_000_000_000_000_000)) |> Decimal.to_string(:normal) %> <%= gettext "POA" %></td> <td class="transactions__column transactions__column--value"><%= value(transaction) %> <%= gettext "Ether" %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -11,8 +11,8 @@
<th class="blocks__column-header"><%= gettext "Height" %></th> <th class="blocks__column-header"><%= gettext "Height" %></th>
<th class="blocks__column-header"><%= gettext "Age" %></th> <th class="blocks__column-header"><%= gettext "Age" %></th>
<th class="blocks__column-header"><%= gettext "Transactions" %></th> <th class="blocks__column-header"><%= gettext "Transactions" %></th>
<th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Used" %></th> <th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Used" %> (<%= gettext("Gas") %>)</th>
<th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Limit" %></th> <th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Limit" %> (<%= gettext("Gas") %>)</th>
<th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Price" %></th> <th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Price" %></th>
</tr> </tr>
</thead> </thead>

@ -40,7 +40,7 @@
<td class="transactions__column transactions__column--to transactions__column--optional"> <td class="transactions__column transactions__column--to transactions__column--optional">
<div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div> <div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div>
</td> </td>
<td class="transactions__column transactions__column--value"><%= Decimal.div(Decimal.new(transaction.value), Decimal.new(1_000_000_000_000_000_000)) |> Decimal.to_string(:normal) %> <%= gettext "POA" %></td> <td class="transactions__column transactions__column--value"><%= value(transaction) %> <%= gettext "Ether" %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -100,7 +100,7 @@
</td> </td>
<td class="transactions__column transactions__column--block"><%= link(transaction.block.number, to: block_path(@conn, :show, @conn.assigns.locale, transaction.block.number), class: "transactions__link") %></td> <td class="transactions__column transactions__column--block"><%= link(transaction.block.number, to: block_path(@conn, :show, @conn.assigns.locale, transaction.block.number), class: "transactions__link") %></td>
<td class="transactions__column transactions__column--age transactions__column--optional"><%= transaction.block.timestamp |> Timex.from_now() %></td> <td class="transactions__column transactions__column--age transactions__column--optional"><%= transaction.block.timestamp |> Timex.from_now() %></td>
<td class="transactions__column transactions__column--value"><%= Decimal.div(Decimal.new(transaction.value), Decimal.new(1_000_000_000_000_000_000)) |> Decimal.to_string(:normal) %> <%= gettext "POA" %></td> <td class="transactions__column transactions__column--value"><%= value(transaction) %> <%= gettext "Ether" %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -44,7 +44,7 @@
<%= gettext "Pending" %> <%= gettext "Pending" %>
<% end %> <% end %>
</td> </td>
<td class="transactions__column transactions__column--value"><%= Decimal.div(Decimal.new(transaction.value), Decimal.new(1_000_000_000_000_000_000)) |> Decimal.to_string(:normal) %> <%= gettext "POA" %></td> <td class="transactions__column transactions__column--value"><%= value(transaction) %> <%= gettext "Ether" %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -40,7 +40,7 @@
<td class="transactions__column transactions__column--to transactions__column--optional"> <td class="transactions__column transactions__column--to transactions__column--optional">
<div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div> <div class="transactions__hash"><%= link(transaction.to_address.hash, to: address_path(@conn, :show, @conn.assigns.locale, transaction.to_address.hash), class: "transactions__link transactions__link--truncated transactions__link--hash") %></div>
</td> </td>
<td class="transactions__column transactions__column--value"><%= Decimal.div(Decimal.new(transaction.value), Decimal.new(1_000_000_000_000_000_000)) |> Decimal.to_string(:normal) %> <%= gettext "POA" %></td> <td class="transactions__column transactions__column--value"><%= value(transaction) %> <%= gettext "Ether" %></td>
</tr> </tr>
<% end %> <% end %>
</tbody> </tbody>

@ -35,7 +35,7 @@
</div> </div>
<div class="transaction__item"> <div class="transaction__item">
<dt class="transaction__item-key"><%= gettext "Value" %></dt> <dt class="transaction__item-key"><%= gettext "Value" %></dt>
<dd class="transaction__item-value"><%= @transaction.value |> ExplorerWeb.WeiConverter.to_ether() |> Decimal.to_string(:normal) %> <%= gettext "POA" %></dd> <dd class="transaction__item-value"><%= value(@transaction) %> <%= gettext "Ether" %></dd>
</div> </div>
<div class="transaction__item"> <div class="transaction__item">
<dt class="transaction__item-key"><%= gettext "From" %></dt> <dt class="transaction__item-key"><%= gettext "From" %></dt>
@ -77,15 +77,15 @@
</div> </div>
<div class="transaction__item"> <div class="transaction__item">
<dt class="transaction__item-key"><%= gettext "Gas Limit" %></dt> <dt class="transaction__item-key"><%= gettext "Gas Limit" %></dt>
<dd class="transaction__item-value"><%= format_gas_limit(@transaction.gas) %></dd> <dd class="transaction__item-value"><%= format_gas_limit(@transaction.gas) %> <%= gettext("Gas") %></dd>
</div> </div>
<div class="transaction__item"> <div class="transaction__item">
<dt class="transaction__item-key"><%= gettext "Gas Price" %></dt> <dt class="transaction__item-key"><%= gettext "Gas Price" %></dt>
<dd class="transaction__item-value"><%= @transaction.gas_price |> Cldr.Number.to_string! %> (<%= @transaction.gas_price |> ExplorerWeb.WeiConverter.to_gwei() |> Decimal.to_string(:normal) %> <%= gettext "Gwei" %>)</dd> <dd class="transaction__item-value"><%= gas_price(@transaction, :wei) %> <%= gettext("Wei") %> (<%= gas_price(@transaction, :gwei) %> <%= gettext "Gwei" %>)</dd>
</div> </div>
<div class="transaction__item"> <div class="transaction__item">
<dt class="transaction__item-key"><%= gettext "Cumulative Gas Used" %></dt> <dt class="transaction__item-key"><%= gettext "Cumulative Gas Used" %></dt>
<dd class="transaction__item-value"><%= cumulative_gas_used(@transaction) %></dd> <dd class="transaction__item-value"><%= cumulative_gas_used(@transaction) %> <%= gettext("Wei") %></dd>
</div> </div>
<div class="transaction__item"> <div class="transaction__item">
<dt class="transaction__item-key"><%= gettext "Input" %></dt> <dt class="transaction__item-key"><%= gettext "Input" %></dt>

@ -13,8 +13,8 @@
<th class="internal-transaction__column-header"><%= gettext "Type" %></th> <th class="internal-transaction__column-header"><%= gettext "Type" %></th>
<th class="internal-transaction__column-header"><%= gettext "From" %></th> <th class="internal-transaction__column-header"><%= gettext "From" %></th>
<th class="internal-transaction__column-header"><%= gettext "To" %></th> <th class="internal-transaction__column-header"><%= gettext "To" %></th>
<th class="internal-transaction__column-header"><%= gettext "Value" %></th> <th class="internal-transaction__column-header"><%= gettext "Value" %> (<%= gettext "Ether" %>)</th>
<th class="internal-transaction__column-header"><%= gettext "Gas Limit" %></th> <th class="internal-transaction__column-header"><%= gettext "Gas Limit" %> (<%= gettext "Gas" %>)</th>
</thead> </thead>
<%= for transaction <- @internal_transactions do %> <%= for transaction <- @internal_transactions do %>
<tgroup> <tgroup>
@ -30,8 +30,8 @@
to: address_path(@conn, :show, @conn.assigns.locale, transaction.from_address.hash), to: address_path(@conn, :show, @conn.assigns.locale, transaction.from_address.hash),
class: "transaction-log__link") %> class: "transaction-log__link") %>
</td> </td>
<td><%= transaction.value %></td> <td><%= value(transaction) %></td>
<td><%= ExplorerWeb.TransactionView.format_gas_limit(transaction.gas) %></td> <td><%= gas(transaction) %></td>
</tr> </tr>
</tgroup> </tgroup>
<% end %> <% end %>

@ -3,7 +3,6 @@ defmodule ExplorerWeb.AddressTransactionFromView do
alias ExplorerWeb.TransactionView alias ExplorerWeb.TransactionView
def status(transacton) do defdelegate status(transacton), to: TransactionView
TransactionView.status(transacton) defdelegate value(transaction), to: TransactionView
end
end end

@ -3,7 +3,6 @@ defmodule ExplorerWeb.AddressTransactionToView do
alias ExplorerWeb.TransactionView alias ExplorerWeb.TransactionView
def status(transacton) do defdelegate status(transacton), to: TransactionView
TransactionView.status(transacton) defdelegate value(transaction), to: TransactionView
end
end end

@ -1,12 +1,10 @@
defmodule ExplorerWeb.BlockTransactionView do defmodule ExplorerWeb.BlockTransactionView do
use ExplorerWeb, :view use ExplorerWeb, :view
alias Explorer.Chain.Transaction
alias ExplorerWeb.TransactionView alias ExplorerWeb.TransactionView
# Functions # Functions
def status(%Transaction{} = transaction) do defdelegate status(transacton), to: TransactionView
TransactionView.status(transaction) defdelegate value(transaction), to: TransactionView
end
end end

@ -1,4 +1,7 @@
defmodule ExplorerWeb.ChainView do defmodule ExplorerWeb.ChainView do
use ExplorerWeb, :view use ExplorerWeb, :view
@dialyzer :no_match
alias ExplorerWeb.TransactionView
defdelegate value(transaction), to: TransactionView
end end

@ -15,9 +15,7 @@ defmodule ExplorerWeb.PendingTransactionView do
end end
end end
def last_seen(transaction) do defdelegate last_seen(transaction), to: TransactionView
TransactionView.last_seen(transaction)
end
def to_address_hash(%Transaction{to_address: to_address}) do def to_address_hash(%Transaction{to_address: to_address}) do
case to_address do case to_address do
@ -25,4 +23,6 @@ defmodule ExplorerWeb.PendingTransactionView do
_ -> nil _ -> nil
end end
end end
defdelegate value(transaction), to: TransactionView
end end

@ -3,7 +3,7 @@ defmodule ExplorerWeb.TransactionView do
alias Cldr.Number alias Cldr.Number
alias Explorer.Chain alias Explorer.Chain
alias Explorer.Chain.{Block, Transaction} alias Explorer.Chain.{Block, InternalTransaction, Transaction}
alias ExplorerWeb.BlockView alias ExplorerWeb.BlockView
# Functions # Functions
@ -44,6 +44,16 @@ defmodule ExplorerWeb.TransactionView do
end end
end end
def gas(%type{gas: gas}) when type in [InternalTransaction, Transaction] do
Cldr.Number.to_string!(gas)
end
def gas_price(transaction, unit) do
transaction
|> Chain.gas_price(unit)
|> Cldr.Number.to_string!()
end
def last_seen(%Transaction{updated_at: updated_at}) do def last_seen(%Transaction{updated_at: updated_at}) do
Timex.from_now(updated_at) Timex.from_now(updated_at)
end end
@ -62,4 +72,10 @@ defmodule ExplorerWeb.TransactionView do
:success -> gettext("Success") :success -> gettext("Success")
end end
end end
def value(transaction) do
transaction
|> Chain.value(:ether)
|> Cldr.Number.to_string!()
end
end end

@ -1,14 +1,16 @@
#: lib/explorer_web/templates/address_transaction/index.html.eex:18 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:19
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:19
#: lib/explorer_web/templates/block/index.html.eex:12 #: lib/explorer_web/templates/block/index.html.eex:12
#: lib/explorer_web/templates/block_transaction/index.html.eex:18 #: lib/explorer_web/templates/block_transaction/index.html.eex:18
#: lib/explorer_web/templates/chain/show.html.eex:61 #: lib/explorer_web/templates/chain/show.html.eex:61
#: lib/explorer_web/templates/chain/show.html.eex:89 #: lib/explorer_web/templates/chain/show.html.eex:89
#: lib/explorer_web/templates/transaction/index.html.eex:18 #: lib/explorer_web/templates/transaction/index.html.eex:18
#: lib/explorer_web/templates/transaction/show.html.eex:39 #: lib/explorer_web/templates/transaction/overview.html.eex:33
msgid "Age" msgid "Age"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:17 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:18
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:18
#: lib/explorer_web/templates/block_transaction/index.html.eex:17 #: lib/explorer_web/templates/block_transaction/index.html.eex:17
#: lib/explorer_web/templates/chain/show.html.eex:28 #: lib/explorer_web/templates/chain/show.html.eex:28
#: lib/explorer_web/templates/chain/show.html.eex:88 #: lib/explorer_web/templates/chain/show.html.eex:88
@ -17,7 +19,7 @@ msgid "Block"
msgstr "" msgstr ""
#: lib/explorer_web/templates/chain/show.html.eex:54 #: lib/explorer_web/templates/chain/show.html.eex:54
#: lib/explorer_web/templates/layout/_header.html.eex:16 #: lib/explorer_web/templates/layout/_header.html.eex:18
msgid "Blocks" msgid "Blocks"
msgstr "" msgstr ""
@ -31,7 +33,8 @@ msgstr ""
msgid "Gas Used" msgid "Gas Used"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:16 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:17
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:17
#: lib/explorer_web/templates/block/show.html.eex:26 #: lib/explorer_web/templates/block/show.html.eex:26
#: lib/explorer_web/templates/block_transaction/index.html.eex:16 #: lib/explorer_web/templates/block_transaction/index.html.eex:16
#: lib/explorer_web/templates/chain/show.html.eex:87 #: lib/explorer_web/templates/chain/show.html.eex:87
@ -50,8 +53,6 @@ msgstr ""
msgid "POA Network Explorer" msgid "POA Network Explorer"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:9
#: lib/explorer_web/templates/address_transaction/index.html.eex:9
#: lib/explorer_web/templates/block/index.html.eex:13 #: lib/explorer_web/templates/block/index.html.eex:13
#: lib/explorer_web/templates/block/show.html.eex:8 #: lib/explorer_web/templates/block/show.html.eex:8
#: lib/explorer_web/templates/block/show.html.eex:22 #: lib/explorer_web/templates/block/show.html.eex:22
@ -59,18 +60,19 @@ msgstr ""
#: lib/explorer_web/templates/chain/show.html.eex:43 #: lib/explorer_web/templates/chain/show.html.eex:43
#: lib/explorer_web/templates/chain/show.html.eex:62 #: lib/explorer_web/templates/chain/show.html.eex:62
#: lib/explorer_web/templates/chain/show.html.eex:81 #: lib/explorer_web/templates/chain/show.html.eex:81
#: lib/explorer_web/templates/layout/_header.html.eex:12
#: lib/explorer_web/templates/pending_transaction/index.html.eex:8 #: lib/explorer_web/templates/pending_transaction/index.html.eex:8
#: lib/explorer_web/templates/transaction/index.html.eex:8 #: lib/explorer_web/templates/transaction/index.html.eex:8
msgid "Transactions" msgid "Transactions"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:21 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:22
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:22
#: lib/explorer_web/templates/block_transaction/index.html.eex:21 #: lib/explorer_web/templates/block_transaction/index.html.eex:21
#: lib/explorer_web/templates/chain/show.html.eex:90 #: lib/explorer_web/templates/chain/show.html.eex:90
#: lib/explorer_web/templates/pending_transaction/index.html.eex:20 #: lib/explorer_web/templates/pending_transaction/index.html.eex:20
#: lib/explorer_web/templates/transaction/index.html.eex:21 #: lib/explorer_web/templates/transaction/index.html.eex:21
#: lib/explorer_web/templates/transaction/show.html.eex:43 #: lib/explorer_web/templates/transaction/overview.html.eex:37
#: lib/explorer_web/templates/transaction/show.html.eex:16
msgid "Value" msgid "Value"
msgstr "" msgstr ""
@ -84,7 +86,8 @@ msgstr ""
#: lib/explorer_web/templates/block/index.html.eex:15 #: lib/explorer_web/templates/block/index.html.eex:15
#: lib/explorer_web/templates/block/show.html.eex:58 #: lib/explorer_web/templates/block/show.html.eex:58
#: lib/explorer_web/templates/transaction/show.html.eex:79 #: lib/explorer_web/templates/transaction/overview.html.eex:79
#: lib/explorer_web/templates/transaction/show.html.eex:17
msgid "Gas Limit" msgid "Gas Limit"
msgstr "" msgstr ""
@ -93,7 +96,7 @@ msgid "Miner"
msgstr "" msgstr ""
#: lib/explorer_web/templates/block/show.html.eex:62 #: lib/explorer_web/templates/block/show.html.eex:62
#: lib/explorer_web/templates/transaction/show.html.eex:91 #: lib/explorer_web/templates/transaction/overview.html.eex:61
msgid "Nonce" msgid "Nonce"
msgstr "" msgstr ""
@ -117,32 +120,35 @@ msgstr ""
msgid "Total Difficulty" msgid "Total Difficulty"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:28 #: lib/explorer_web/templates/transaction/overview.html.eex:19
msgid "Block Number" msgid "Block Number"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:3 #: lib/explorer_web/templates/transaction/overview.html.eex:2
msgid "Transaction Details" msgid "Transaction Details"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:87 #: lib/explorer_web/templates/transaction/overview.html.eex:87
msgid "Cumulative Gas Used" msgid "Cumulative Gas Used"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:37 #: lib/explorer_web/templates/block/index.html.eex:14
#: lib/explorer_web/templates/block/index.html.eex:15
#: lib/explorer_web/templates/transaction/overview.html.eex:80
#: lib/explorer_web/templates/transaction/show.html.eex:17
msgid "Gas" msgid "Gas"
msgstr "" msgstr ""
#: lib/explorer_web/templates/block/index.html.eex:16 #: lib/explorer_web/templates/block/index.html.eex:16
#: lib/explorer_web/templates/transaction/show.html.eex:83 #: lib/explorer_web/templates/transaction/overview.html.eex:83
msgid "Gas Price" msgid "Gas Price"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:95 #: lib/explorer_web/templates/transaction/overview.html.eex:91
msgid "Input" msgid "Input"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:34 #: lib/explorer_web/templates/transaction/overview.html.eex:28
msgid "%{confirmations} block confirmations" msgid "%{confirmations} block confirmations"
msgstr "" msgstr ""
@ -155,44 +161,48 @@ msgstr ""
msgid "Address" msgid "Address"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:19 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:20
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:20
#: lib/explorer_web/templates/block_transaction/index.html.eex:19 #: lib/explorer_web/templates/block_transaction/index.html.eex:19
#: lib/explorer_web/templates/pending_transaction/index.html.eex:18 #: lib/explorer_web/templates/pending_transaction/index.html.eex:18
#: lib/explorer_web/templates/transaction/index.html.eex:19 #: lib/explorer_web/templates/transaction/index.html.eex:19
#: lib/explorer_web/templates/transaction/show.html.eex:47 #: lib/explorer_web/templates/transaction/overview.html.eex:41
#: lib/explorer_web/templates/transaction/show.html.eex:14
msgid "From" msgid "From"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:8 #: lib/explorer_web/templates/address/show.html.eex:8
#: lib/explorer_web/templates/address_transaction/index.html.eex:8 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:8
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:8
#: lib/explorer_web/templates/block/show.html.eex:7 #: lib/explorer_web/templates/block/show.html.eex:7
#: lib/explorer_web/templates/block_transaction/index.html.eex:8 #: lib/explorer_web/templates/block_transaction/index.html.eex:8
#: lib/explorer_web/templates/transaction/show.html.eex:8
#: lib/explorer_web/templates/transaction_log/index.html.eex:8
msgid "Overview" msgid "Overview"
msgstr "" msgstr ""
#: lib/explorer/forms/transaction_form.ex:83 #: lib/explorer_web/views/transaction_view.ex:72
msgid "Success" msgid "Success"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:20 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:21
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:21
#: lib/explorer_web/templates/block_transaction/index.html.eex:20 #: lib/explorer_web/templates/block_transaction/index.html.eex:20
#: lib/explorer_web/templates/pending_transaction/index.html.eex:19 #: lib/explorer_web/templates/pending_transaction/index.html.eex:19
#: lib/explorer_web/templates/transaction/index.html.eex:20 #: lib/explorer_web/templates/transaction/index.html.eex:20
#: lib/explorer_web/templates/transaction/show.html.eex:57 #: lib/explorer_web/templates/transaction/overview.html.eex:51
#: lib/explorer_web/templates/transaction/show.html.eex:15
msgid "To" msgid "To"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:15 #: lib/explorer_web/templates/transaction/overview.html.eex:10
#: lib/explorer_web/templates/transaction/overview.html.eex:10
msgid "Transaction Hash" msgid "Transaction Hash"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:19 #: lib/explorer_web/templates/transaction/overview.html.eex:10
msgid "Transaction Status" msgid "Transaction Status"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:14 #: lib/explorer_web/templates/address/show.html.eex:15
msgid "Balance" msgid "Balance"
msgstr "" msgstr ""
@ -218,32 +228,30 @@ msgstr ""
msgid "Showing %{count} Transactions" msgid "Showing %{count} Transactions"
msgstr "" msgstr ""
#: lib/explorer/forms/pending_transaction_form.ex:13
#: lib/explorer/forms/transaction_form.ex:42
#: lib/explorer/forms/transaction_form.ex:46
#: lib/explorer/forms/transaction_form.ex:50
#: lib/explorer/forms/transaction_form.ex:54
#: lib/explorer/forms/transaction_form.ex:84
#: lib/explorer_web/templates/pending_transaction/index.html.eex:9 #: lib/explorer_web/templates/pending_transaction/index.html.eex:9
#: lib/explorer_web/templates/pending_transaction/index.html.eex:35 #: lib/explorer_web/templates/pending_transaction/index.html.eex:36
#: lib/explorer_web/templates/pending_transaction/index.html.eex:42 #: lib/explorer_web/templates/pending_transaction/index.html.eex:44
#: lib/explorer_web/templates/transaction/index.html.eex:9 #: lib/explorer_web/templates/transaction/index.html.eex:9
#: lib/explorer_web/templates/transaction/show.html.eex:52 #: lib/explorer_web/templates/transaction/overview.html.eex:46
#: lib/explorer_web/templates/transaction/show.html.eex:62 #: lib/explorer_web/templates/transaction/overview.html.eex:56
#: lib/explorer_web/views/transaction_view.ex:20
#: lib/explorer_web/views/transaction_view.ex:35
#: lib/explorer_web/views/transaction_view.ex:42
#: lib/explorer_web/views/transaction_view.ex:71
msgid "Pending" msgid "Pending"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:71 #: lib/explorer_web/templates/transaction/overview.html.eex:69
msgid "First Seen" msgid "First Seen"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:17 #: lib/explorer_web/templates/pending_transaction/index.html.eex:17
#: lib/explorer_web/templates/transaction/show.html.eex:75 #: lib/explorer_web/templates/transaction/overview.html.eex:74
msgid "Last Seen" msgid "Last Seen"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:9 #: lib/explorer_web/templates/transaction/show.html.eex:7
#: lib/explorer_web/templates/transaction_log/index.html.eex:9 #: lib/explorer_web/templates/transaction_log/index.html.eex:7
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
@ -287,32 +295,86 @@ msgstr ""
msgid "TPM" msgid "TPM"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:50 #: lib/explorer_web/templates/pending_transaction/index.html.eex:52
#: lib/explorer_web/templates/transaction/index.html.eex:48 #: lib/explorer_web/templates/transaction/index.html.eex:48
msgid "Next Page" msgid "Next Page"
msgstr "" msgstr ""
#: lib/explorer/forms/transaction_form.ex:82 #: lib/explorer_web/views/transaction_view.ex:69
msgid "Failed" msgid "Failed"
msgstr "" msgstr ""
#: lib/explorer/forms/transaction_form.ex:81 #: lib/explorer_web/views/transaction_view.ex:70
msgid "Out of Gas" msgid "Out of Gas"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:15 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:16
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:16
#: lib/explorer_web/templates/block_transaction/index.html.eex:15 #: lib/explorer_web/templates/block_transaction/index.html.eex:15
#: lib/explorer_web/templates/pending_transaction/index.html.eex:15 #: lib/explorer_web/templates/pending_transaction/index.html.eex:15
#: lib/explorer_web/templates/transaction/index.html.eex:15 #: lib/explorer_web/templates/transaction/index.html.eex:15
msgid "Status" msgid "Status"
msgstr "" msgstr ""
#, elixir-format #: lib/explorer_web/templates/address_transaction_from/index.html.eex:3
#: lib/explorer_web/templates/address_transaction/index.html.eex:3 #: lib/explorer_web/templates/address_transaction_to/index.html.eex:3
msgid "Address %{number}" msgid "Address %{number}"
msgstr "" msgstr ""
#, elixir-format
#: lib/explorer_web/templates/block_transaction/index.html.eex:3 #: lib/explorer_web/templates/block_transaction/index.html.eex:3
msgid "Showing #%{number}" msgid "Showing #%{number}"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:16
#: lib/explorer_web/templates/address_transaction_from/index.html.eex:44
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:44
#: lib/explorer_web/templates/block_transaction/index.html.eex:43
#: lib/explorer_web/templates/chain/show.html.eex:103
#: lib/explorer_web/templates/pending_transaction/index.html.eex:47
#: lib/explorer_web/templates/transaction/index.html.eex:43
#: lib/explorer_web/templates/transaction/overview.html.eex:38
#: lib/explorer_web/templates/transaction/show.html.eex:16
msgid "Ether"
msgstr ""
#: lib/explorer_web/templates/transaction/overview.html.eex:84
msgid "Gwei"
msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:6
#: lib/explorer_web/templates/transaction_log/index.html.eex:6
msgid "Internal Transactions"
msgstr ""
#: lib/explorer_web/templates/layout/_header.html.eex:12
msgid "Search by address, transaction hash, or block number"
msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:40
msgid "There are no Internal Transactions"
msgstr ""
#: lib/explorer_web/templates/transaction_log/index.html.eex:45
msgid "There are no logs currently."
msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:10
#: lib/explorer_web/templates/address_transaction_from/index.html.eex:10
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:10
msgid "Transactions From"
msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:9
#: lib/explorer_web/templates/address_transaction_from/index.html.eex:9
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:9
msgid "Transactions To"
msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:13
msgid "Type"
msgstr ""
#: lib/explorer_web/templates/transaction/overview.html.eex:84
#: lib/explorer_web/templates/transaction/overview.html.eex:88
msgid "Wei"
msgstr ""

@ -10,17 +10,19 @@ msgid ""
msgstr "" msgstr ""
"Language: en\n" "Language: en\n"
#: lib/explorer_web/templates/address_transaction/index.html.eex:18 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:19
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:19
#: lib/explorer_web/templates/block/index.html.eex:12 #: lib/explorer_web/templates/block/index.html.eex:12
#: lib/explorer_web/templates/block_transaction/index.html.eex:18 #: lib/explorer_web/templates/block_transaction/index.html.eex:18
#: lib/explorer_web/templates/chain/show.html.eex:61 #: lib/explorer_web/templates/chain/show.html.eex:61
#: lib/explorer_web/templates/chain/show.html.eex:89 #: lib/explorer_web/templates/chain/show.html.eex:89
#: lib/explorer_web/templates/transaction/index.html.eex:18 #: lib/explorer_web/templates/transaction/index.html.eex:18
#: lib/explorer_web/templates/transaction/show.html.eex:39 #: lib/explorer_web/templates/transaction/overview.html.eex:33
msgid "Age" msgid "Age"
msgstr "Age" msgstr "Age"
#: lib/explorer_web/templates/address_transaction/index.html.eex:17 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:18
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:18
#: lib/explorer_web/templates/block_transaction/index.html.eex:17 #: lib/explorer_web/templates/block_transaction/index.html.eex:17
#: lib/explorer_web/templates/chain/show.html.eex:28 #: lib/explorer_web/templates/chain/show.html.eex:28
#: lib/explorer_web/templates/chain/show.html.eex:88 #: lib/explorer_web/templates/chain/show.html.eex:88
@ -29,7 +31,7 @@ msgid "Block"
msgstr "Block" msgstr "Block"
#: lib/explorer_web/templates/chain/show.html.eex:54 #: lib/explorer_web/templates/chain/show.html.eex:54
#: lib/explorer_web/templates/layout/_header.html.eex:16 #: lib/explorer_web/templates/layout/_header.html.eex:18
msgid "Blocks" msgid "Blocks"
msgstr "Blocks" msgstr "Blocks"
@ -43,7 +45,8 @@ msgstr "%{year} POA Network Ltd. All rights reserved"
msgid "Gas Used" msgid "Gas Used"
msgstr "Gas Used" msgstr "Gas Used"
#: lib/explorer_web/templates/address_transaction/index.html.eex:16 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:17
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:17
#: lib/explorer_web/templates/block/show.html.eex:26 #: lib/explorer_web/templates/block/show.html.eex:26
#: lib/explorer_web/templates/block_transaction/index.html.eex:16 #: lib/explorer_web/templates/block_transaction/index.html.eex:16
#: lib/explorer_web/templates/chain/show.html.eex:87 #: lib/explorer_web/templates/chain/show.html.eex:87
@ -62,8 +65,6 @@ msgstr "Height"
msgid "POA Network Explorer" msgid "POA Network Explorer"
msgstr "POA Network Explorer" msgstr "POA Network Explorer"
#: lib/explorer_web/templates/address/show.html.eex:9
#: lib/explorer_web/templates/address_transaction/index.html.eex:9
#: lib/explorer_web/templates/block/index.html.eex:13 #: lib/explorer_web/templates/block/index.html.eex:13
#: lib/explorer_web/templates/block/show.html.eex:8 #: lib/explorer_web/templates/block/show.html.eex:8
#: lib/explorer_web/templates/block/show.html.eex:22 #: lib/explorer_web/templates/block/show.html.eex:22
@ -71,18 +72,19 @@ msgstr "POA Network Explorer"
#: lib/explorer_web/templates/chain/show.html.eex:43 #: lib/explorer_web/templates/chain/show.html.eex:43
#: lib/explorer_web/templates/chain/show.html.eex:62 #: lib/explorer_web/templates/chain/show.html.eex:62
#: lib/explorer_web/templates/chain/show.html.eex:81 #: lib/explorer_web/templates/chain/show.html.eex:81
#: lib/explorer_web/templates/layout/_header.html.eex:12
#: lib/explorer_web/templates/pending_transaction/index.html.eex:8 #: lib/explorer_web/templates/pending_transaction/index.html.eex:8
#: lib/explorer_web/templates/transaction/index.html.eex:8 #: lib/explorer_web/templates/transaction/index.html.eex:8
msgid "Transactions" msgid "Transactions"
msgstr "Transactions" msgstr "Transactions"
#: lib/explorer_web/templates/address_transaction/index.html.eex:21 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:22
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:22
#: lib/explorer_web/templates/block_transaction/index.html.eex:21 #: lib/explorer_web/templates/block_transaction/index.html.eex:21
#: lib/explorer_web/templates/chain/show.html.eex:90 #: lib/explorer_web/templates/chain/show.html.eex:90
#: lib/explorer_web/templates/pending_transaction/index.html.eex:20 #: lib/explorer_web/templates/pending_transaction/index.html.eex:20
#: lib/explorer_web/templates/transaction/index.html.eex:21 #: lib/explorer_web/templates/transaction/index.html.eex:21
#: lib/explorer_web/templates/transaction/show.html.eex:43 #: lib/explorer_web/templates/transaction/overview.html.eex:37
#: lib/explorer_web/templates/transaction/show.html.eex:16
msgid "Value" msgid "Value"
msgstr "Value" msgstr "Value"
@ -96,7 +98,8 @@ msgstr "Difficulty"
#: lib/explorer_web/templates/block/index.html.eex:15 #: lib/explorer_web/templates/block/index.html.eex:15
#: lib/explorer_web/templates/block/show.html.eex:58 #: lib/explorer_web/templates/block/show.html.eex:58
#: lib/explorer_web/templates/transaction/show.html.eex:79 #: lib/explorer_web/templates/transaction/overview.html.eex:79
#: lib/explorer_web/templates/transaction/show.html.eex:17
msgid "Gas Limit" msgid "Gas Limit"
msgstr "Gas Limit" msgstr "Gas Limit"
@ -105,7 +108,7 @@ msgid "Miner"
msgstr "Validator" msgstr "Validator"
#: lib/explorer_web/templates/block/show.html.eex:62 #: lib/explorer_web/templates/block/show.html.eex:62
#: lib/explorer_web/templates/transaction/show.html.eex:91 #: lib/explorer_web/templates/transaction/overview.html.eex:61
msgid "Nonce" msgid "Nonce"
msgstr "Nonce" msgstr "Nonce"
@ -129,32 +132,35 @@ msgstr "Timestamp"
msgid "Total Difficulty" msgid "Total Difficulty"
msgstr "Total Difficulty" msgstr "Total Difficulty"
#: lib/explorer_web/templates/transaction/show.html.eex:28 #: lib/explorer_web/templates/transaction/overview.html.eex:19
msgid "Block Number" msgid "Block Number"
msgstr "Block Height" msgstr "Block Height"
#: lib/explorer_web/templates/transaction/show.html.eex:3 #: lib/explorer_web/templates/transaction/overview.html.eex:2
msgid "Transaction Details" msgid "Transaction Details"
msgstr "Transaction Details" msgstr "Transaction Details"
#: lib/explorer_web/templates/transaction/show.html.eex:87 #: lib/explorer_web/templates/transaction/overview.html.eex:87
msgid "Cumulative Gas Used" msgid "Cumulative Gas Used"
msgstr "Cumulative Gas Used" msgstr "Cumulative Gas Used"
#: lib/explorer_web/templates/transaction/show.html.eex:37 #: lib/explorer_web/templates/block/index.html.eex:14
#: lib/explorer_web/templates/block/index.html.eex:15
#: lib/explorer_web/templates/transaction/overview.html.eex:80
#: lib/explorer_web/templates/transaction/show.html.eex:17
msgid "Gas" msgid "Gas"
msgstr "Gas" msgstr "Gas"
#: lib/explorer_web/templates/block/index.html.eex:16 #: lib/explorer_web/templates/block/index.html.eex:16
#: lib/explorer_web/templates/transaction/show.html.eex:83 #: lib/explorer_web/templates/transaction/overview.html.eex:83
msgid "Gas Price" msgid "Gas Price"
msgstr "Gas Price" msgstr "Gas Price"
#: lib/explorer_web/templates/transaction/show.html.eex:95 #: lib/explorer_web/templates/transaction/overview.html.eex:91
msgid "Input" msgid "Input"
msgstr "Input" msgstr "Input"
#: lib/explorer_web/templates/transaction/show.html.eex:34 #: lib/explorer_web/templates/transaction/overview.html.eex:28
msgid "%{confirmations} block confirmations" msgid "%{confirmations} block confirmations"
msgstr "%{confirmations} block confirmations" msgstr "%{confirmations} block confirmations"
@ -167,44 +173,48 @@ msgstr "%{count} transactions in this block"
msgid "Address" msgid "Address"
msgstr "Address" msgstr "Address"
#: lib/explorer_web/templates/address_transaction/index.html.eex:19 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:20
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:20
#: lib/explorer_web/templates/block_transaction/index.html.eex:19 #: lib/explorer_web/templates/block_transaction/index.html.eex:19
#: lib/explorer_web/templates/pending_transaction/index.html.eex:18 #: lib/explorer_web/templates/pending_transaction/index.html.eex:18
#: lib/explorer_web/templates/transaction/index.html.eex:19 #: lib/explorer_web/templates/transaction/index.html.eex:19
#: lib/explorer_web/templates/transaction/show.html.eex:47 #: lib/explorer_web/templates/transaction/overview.html.eex:41
#: lib/explorer_web/templates/transaction/show.html.eex:14
msgid "From" msgid "From"
msgstr "From" msgstr "From"
#: lib/explorer_web/templates/address/show.html.eex:8 #: lib/explorer_web/templates/address/show.html.eex:8
#: lib/explorer_web/templates/address_transaction/index.html.eex:8 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:8
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:8
#: lib/explorer_web/templates/block/show.html.eex:7 #: lib/explorer_web/templates/block/show.html.eex:7
#: lib/explorer_web/templates/block_transaction/index.html.eex:8 #: lib/explorer_web/templates/block_transaction/index.html.eex:8
#: lib/explorer_web/templates/transaction/show.html.eex:8
#: lib/explorer_web/templates/transaction_log/index.html.eex:8
msgid "Overview" msgid "Overview"
msgstr "Overview" msgstr "Overview"
#: lib/explorer/forms/transaction_form.ex:83 #: lib/explorer_web/views/transaction_view.ex:72
msgid "Success" msgid "Success"
msgstr "Success" msgstr "Success"
#: lib/explorer_web/templates/address_transaction/index.html.eex:20 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:21
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:21
#: lib/explorer_web/templates/block_transaction/index.html.eex:20 #: lib/explorer_web/templates/block_transaction/index.html.eex:20
#: lib/explorer_web/templates/pending_transaction/index.html.eex:19 #: lib/explorer_web/templates/pending_transaction/index.html.eex:19
#: lib/explorer_web/templates/transaction/index.html.eex:20 #: lib/explorer_web/templates/transaction/index.html.eex:20
#: lib/explorer_web/templates/transaction/show.html.eex:57 #: lib/explorer_web/templates/transaction/overview.html.eex:51
#: lib/explorer_web/templates/transaction/show.html.eex:15
msgid "To" msgid "To"
msgstr "To" msgstr "To"
#: lib/explorer_web/templates/transaction/show.html.eex:15 #: lib/explorer_web/templates/transaction/overview.html.eex:10
#: lib/explorer_web/templates/transaction/overview.html.eex:10
msgid "Transaction Hash" msgid "Transaction Hash"
msgstr "Transaction Hash" msgstr "Transaction Hash"
#: lib/explorer_web/templates/transaction/show.html.eex:19 #: lib/explorer_web/templates/transaction/overview.html.eex:10
msgid "Transaction Status" msgid "Transaction Status"
msgstr "Transaction Status" msgstr "Transaction Status"
#: lib/explorer_web/templates/address/show.html.eex:14 #: lib/explorer_web/templates/address/show.html.eex:15
msgid "Balance" msgid "Balance"
msgstr "Balance" msgstr "Balance"
@ -230,32 +240,30 @@ msgstr "Showing #%{start_block} to #%{end_block}"
msgid "Showing %{count} Transactions" msgid "Showing %{count} Transactions"
msgstr "Showing %{count} Transactions" msgstr "Showing %{count} Transactions"
#: lib/explorer/forms/pending_transaction_form.ex:13
#: lib/explorer/forms/transaction_form.ex:42
#: lib/explorer/forms/transaction_form.ex:46
#: lib/explorer/forms/transaction_form.ex:50
#: lib/explorer/forms/transaction_form.ex:54
#: lib/explorer/forms/transaction_form.ex:84
#: lib/explorer_web/templates/pending_transaction/index.html.eex:9 #: lib/explorer_web/templates/pending_transaction/index.html.eex:9
#: lib/explorer_web/templates/pending_transaction/index.html.eex:35 #: lib/explorer_web/templates/pending_transaction/index.html.eex:36
#: lib/explorer_web/templates/pending_transaction/index.html.eex:42 #: lib/explorer_web/templates/pending_transaction/index.html.eex:44
#: lib/explorer_web/templates/transaction/index.html.eex:9 #: lib/explorer_web/templates/transaction/index.html.eex:9
#: lib/explorer_web/templates/transaction/show.html.eex:52 #: lib/explorer_web/templates/transaction/overview.html.eex:46
#: lib/explorer_web/templates/transaction/show.html.eex:62 #: lib/explorer_web/templates/transaction/overview.html.eex:56
#: lib/explorer_web/views/transaction_view.ex:20
#: lib/explorer_web/views/transaction_view.ex:35
#: lib/explorer_web/views/transaction_view.ex:42
#: lib/explorer_web/views/transaction_view.ex:71
msgid "Pending" msgid "Pending"
msgstr "Pending" msgstr "Pending"
#: lib/explorer_web/templates/transaction/show.html.eex:71 #: lib/explorer_web/templates/transaction/overview.html.eex:69
msgid "First Seen" msgid "First Seen"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:17 #: lib/explorer_web/templates/pending_transaction/index.html.eex:17
#: lib/explorer_web/templates/transaction/show.html.eex:75 #: lib/explorer_web/templates/transaction/overview.html.eex:74
msgid "Last Seen" msgid "Last Seen"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:9 #: lib/explorer_web/templates/transaction/show.html.eex:7
#: lib/explorer_web/templates/transaction_log/index.html.eex:9 #: lib/explorer_web/templates/transaction_log/index.html.eex:7
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
@ -299,32 +307,86 @@ msgstr ""
msgid "TPM" msgid "TPM"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:50 #: lib/explorer_web/templates/pending_transaction/index.html.eex:52
#: lib/explorer_web/templates/transaction/index.html.eex:48 #: lib/explorer_web/templates/transaction/index.html.eex:48
msgid "Next Page" msgid "Next Page"
msgstr "" msgstr ""
#: lib/explorer/forms/transaction_form.ex:82 #: lib/explorer_web/views/transaction_view.ex:69
msgid "Failed" msgid "Failed"
msgstr "" msgstr ""
#: lib/explorer/forms/transaction_form.ex:81 #: lib/explorer_web/views/transaction_view.ex:70
msgid "Out of Gas" msgid "Out of Gas"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:15 #: lib/explorer_web/templates/address_transaction_from/index.html.eex:16
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:16
#: lib/explorer_web/templates/block_transaction/index.html.eex:15 #: lib/explorer_web/templates/block_transaction/index.html.eex:15
#: lib/explorer_web/templates/pending_transaction/index.html.eex:15 #: lib/explorer_web/templates/pending_transaction/index.html.eex:15
#: lib/explorer_web/templates/transaction/index.html.eex:15 #: lib/explorer_web/templates/transaction/index.html.eex:15
msgid "Status" msgid "Status"
msgstr "" msgstr ""
#, elixir-format #: lib/explorer_web/templates/address_transaction_from/index.html.eex:3
#: lib/explorer_web/templates/address_transaction/index.html.eex:3 #: lib/explorer_web/templates/address_transaction_to/index.html.eex:3
msgid "Address %{number}" msgid "Address %{number}"
msgstr "" msgstr ""
#, elixir-format
#: lib/explorer_web/templates/block_transaction/index.html.eex:3 #: lib/explorer_web/templates/block_transaction/index.html.eex:3
msgid "Showing #%{number}" msgid "Showing #%{number}"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:16
#: lib/explorer_web/templates/address_transaction_from/index.html.eex:44
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:44
#: lib/explorer_web/templates/block_transaction/index.html.eex:43
#: lib/explorer_web/templates/chain/show.html.eex:103
#: lib/explorer_web/templates/pending_transaction/index.html.eex:47
#: lib/explorer_web/templates/transaction/index.html.eex:43
#: lib/explorer_web/templates/transaction/overview.html.eex:38
#: lib/explorer_web/templates/transaction/show.html.eex:16
msgid "Ether"
msgstr "POA"
#: lib/explorer_web/templates/transaction/overview.html.eex:84
msgid "Gwei"
msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:6
#: lib/explorer_web/templates/transaction_log/index.html.eex:6
msgid "Internal Transactions"
msgstr ""
#: lib/explorer_web/templates/layout/_header.html.eex:12
msgid "Search by address, transaction hash, or block number"
msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:40
msgid "There are no Internal Transactions"
msgstr ""
#: lib/explorer_web/templates/transaction_log/index.html.eex:45
msgid "There are no logs currently."
msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:10
#: lib/explorer_web/templates/address_transaction_from/index.html.eex:10
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:10
msgid "Transactions From"
msgstr ""
#: lib/explorer_web/templates/address/show.html.eex:9
#: lib/explorer_web/templates/address_transaction_from/index.html.eex:9
#: lib/explorer_web/templates/address_transaction_to/index.html.eex:9
msgid "Transactions To"
msgstr ""
#: lib/explorer_web/templates/transaction/show.html.eex:13
msgid "Type"
msgstr ""
#: lib/explorer_web/templates/transaction/overview.html.eex:84
#: lib/explorer_web/templates/transaction/overview.html.eex:88
msgid "Wei"
msgstr ""

@ -76,7 +76,9 @@ defmodule ExplorerWeb.TransactionControllerTest do
assert html = html_response(conn, 200) assert html = html_response(conn, 200)
assert html |> Floki.find("div.transaction__header h3") |> Floki.text() == transaction.hash assert html |> Floki.find("div.transaction__header h3") |> Floki.text() == transaction.hash
assert html |> Floki.find("span.transaction__item--primary a") |> Floki.text() == to_string(block.number)
assert html |> Floki.find("span.transaction__item--primary a") |> Floki.text() ==
to_string(block.number)
end end
test "returns a transaction without associated block data", %{conn: conn} do test "returns a transaction without associated block data", %{conn: conn} do

@ -123,9 +123,9 @@ defmodule ExplorerWeb.UserListTest do
insert( insert(
:transaction, :transaction,
hash: "0xSk8", hash: "0xSk8",
value: 5656, value: Explorer.Chain.Wei.from(Decimal.new(5656), :ether),
gas: 1_230_000_000_000_123_123, gas: Decimal.new(1_230_000_000_000_123_123),
gas_price: 7_890_000_000_898_912_300_045, gas_price: Decimal.new(7_890_000_000_898_912_300_045),
input: "0x00012", input: "0x00012",
nonce: 99045, nonce: 99045,
inserted_at: Timex.parse!("1970-01-01T00:00:18-00:00", "{ISO:Extended}"), inserted_at: Timex.parse!("1970-01-01T00:00:18-00:00", "{ISO:Extended}"),
@ -172,10 +172,15 @@ defmodule ExplorerWeb.UserListTest do
|> click(link("0xSk8")) |> click(link("0xSk8"))
|> assert_has(css(".transaction__subheading", text: "0xSk8")) |> assert_has(css(".transaction__subheading", text: "0xSk8"))
|> assert_has(css(".transaction__item", text: "123,987")) |> assert_has(css(".transaction__item", text: "123,987"))
|> assert_has(css(".transaction__item", text: "5656 POA")) |> assert_has(css(".transaction__item", text: "5,656 POA"))
|> assert_has(css(".transaction__item", text: "Success")) |> assert_has(css(".transaction__item", text: "Success"))
|> assert_has(css(".transaction__item", text: "7,890,000,000,898,912,300,045")) |> assert_has(
|> assert_has(css(".transaction__item", text: "1,230,000,000,000,123,123")) css(
".transaction__item",
text: "7,890,000,000,898,912,300,045 Wei (7,890,000,000,898.912 Gwei)"
)
)
|> assert_has(css(".transaction__item", text: "1,230,000,000,000,123,123 Gas"))
|> assert_has(css(".transaction__item", text: "0x00012")) |> assert_has(css(".transaction__item", text: "0x00012"))
|> assert_has(css(".transaction__item", text: "99045")) |> assert_has(css(".transaction__item", text: "99045"))
|> assert_has(css(".transaction__item", text: "123,987")) |> assert_has(css(".transaction__item", text: "123,987"))

@ -1,19 +0,0 @@
defmodule ExplorerWeb.WeiConverterTest do
use ExUnit.Case
alias ExplorerWeb.WeiConverter
test "it converts wei to ether correctly" do
wei = Decimal.new(239_047_000_000_000)
expected_value = Decimal.new(0.000239047)
assert WeiConverter.to_ether(wei) == expected_value
end
test "it converts wei to Gwei correctly" do
wei = Decimal.new(239_047_123_000_000)
expected_value = Decimal.new(239_047.123)
assert WeiConverter.to_gwei(wei) == expected_value
end
end
Loading…
Cancel
Save