Transaction list page redesign
pull/404/head
Jimmy Lauzau 6 years ago committed by GitHub
commit 516e57a1df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      apps/explorer_web/assets/css/_typography.scss
  2. 11
      apps/explorer_web/assets/css/components/_tile.scss
  3. 8
      apps/explorer_web/lib/explorer_web/templates/address/_link.html.eex
  4. 6
      apps/explorer_web/lib/explorer_web/templates/address/_responsive_hash.html.eex
  5. 2
      apps/explorer_web/lib/explorer_web/templates/address/overview.html.eex
  6. 8
      apps/explorer_web/lib/explorer_web/templates/address_internal_transaction/_internal_transaction.html.eex
  7. 8
      apps/explorer_web/lib/explorer_web/templates/address_transaction/_transaction.html.eex
  8. 4
      apps/explorer_web/lib/explorer_web/templates/block_transaction/index.html.eex
  9. 4
      apps/explorer_web/lib/explorer_web/templates/chain/_transactions.html.eex
  10. 98
      apps/explorer_web/lib/explorer_web/templates/pending_transaction/index.html.eex
  11. 126
      apps/explorer_web/lib/explorer_web/templates/transaction/index.html.eex
  12. 4
      apps/explorer_web/lib/explorer_web/templates/transaction_internal_transaction/index.html.eex
  13. 12
      apps/explorer_web/lib/explorer_web/views/address_view.ex
  14. 4
      apps/explorer_web/lib/explorer_web/views/transaction_view.ex
  15. 45
      apps/explorer_web/priv/gettext/default.pot
  16. 49
      apps/explorer_web/priv/gettext/en/LC_MESSAGES/default.po
  17. 6
      apps/explorer_web/test/explorer_web/features/pages/transaction_list_page.ex
  18. 4
      apps/explorer_web/test/explorer_web/features/viewing_transactions_test.exs

@ -50,3 +50,8 @@ a {
.monospace { .monospace {
font-family: $font-family-monospace; font-family: $font-family-monospace;
} }
.contract-address {
text-decoration: underline;
text-decoration-style: dashed;
}

@ -27,10 +27,10 @@
} }
} }
&-contract { &-contract-call {
border-left: 4px solid $green; border-left: 4px solid $green;
.tile-label, .tile-text-highlight { .tile-label {
color: $green; color: $green;
} }
} }
@ -38,9 +38,14 @@
&-contract-creation { &-contract-creation {
border-left: 4px solid $pink; border-left: 4px solid $pink;
.tile-label, .tile-text-highlight { .tile-label {
color: $pink; color: $pink;
} }
.tile-text-highlight {
text-decoration: underline;
text-decoration-style: dashed;
}
} }
&-token { &-token {

@ -1,11 +1,5 @@
<%= if @address_hash do %> <%= if @address_hash do %>
<%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @address_hash), "data-address-hash": @address_hash, "data-test": "address_hash_link" do %> <%= link to: address_path(ExplorerWeb.Endpoint, :show, @locale, @address_hash), "data-address-hash": @address_hash, "data-test": "address_hash_link" do %>
<%= if @contract do %> <%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @address_hash, contract: @contract %>
<span class="tile-text-highlight">
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @address_hash %>
</span>
<% else %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @address_hash %>
<% end %>
<% end %> <% end %>
<% end %> <% end %>

@ -1,2 +1,4 @@
<span class="d-none d-md-none d-lg-inline"><%= @address_hash %></span> <span class="<%= if @contract do %>contract-address<% end %>">
<span class="d-md-block d-lg-none "><%= @address_hash |> to_string() |> String.slice(0..5) %>&ndash;<%= @address_hash |> to_string() |> String.slice(-6..-1) %></span> <span class="d-none d-md-none d-lg-inline"><%= @address_hash %></span>
<span class="d-md-block d-lg-none "><%= ExplorerWeb.AddressView.trimmed_hash(@address_hash) %></span>
</span>

@ -16,7 +16,7 @@
</span> </span>
</div> </div>
<h1 class="card-title"><%= address_title(@address) %> Details </h1> <h1 class="card-title"><%= address_title(@address) %> Details </h1>
<h3 class="" data-test="address_detail_hash"><%= @address %></h3> <h3 class="<%= if ExplorerWeb.AddressView.contract?(@address) do %>contract-address<% end %>" data-test="address_detail_hash"><%= @address %></h3>
<div class="d-flex flex-row justify-content-start text-muted"> <div class="d-flex flex-row justify-content-start text-muted">
<span class="mr-4" data-test="transaction_count"><%= Cldr.Number.to_string!(@transaction_count) %> <%= gettext "Transactions" %></span> <span class="mr-4" data-test="transaction_count"><%= Cldr.Number.to_string!(@transaction_count) %> <%= gettext "Transactions" %></span>
</div> </div>

@ -7,15 +7,15 @@
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @internal_transaction.transaction_hash %> <%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @internal_transaction.transaction_hash %>
<span> <span>
<%= if @address.hash == @internal_transaction.from_address_hash do %> <%= if @address.hash == @internal_transaction.from_address_hash do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @internal_transaction.from_address_hash %> <%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.from_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.from_address), address_hash: @internal_transaction.from_address_hash %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: @internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.from_address), locale: @locale %>
<% end %> <% end %>
&rarr; &rarr;
<%= if @address.hash == ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction) do %> <%= if @address.hash == ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction) do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction) %> <%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: ExplorerWeb.AddressView.contract?(@internal_transaction.to_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.to_address), address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction) %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: ExplorerWeb.AddressView.contract?(@internal_transaction.to_address), locale: @locale %>
<% end %> <% end %>
</span> </span>
<%= ExplorerWeb.TransactionView.value(@internal_transaction, include_label: false) %> POA <%= ExplorerWeb.TransactionView.value(@internal_transaction, include_label: false) %> POA

@ -7,15 +7,15 @@
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %> <%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %>
<span> <span>
<%= if @address.hash == @transaction.from_address_hash do %> <%= if @address.hash == @transaction.from_address_hash do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @transaction.from_address_hash %> <%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address), address_hash: @transaction.from_address_hash %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address), locale: @locale %>
<% end %> <% end %>
&rarr; &rarr;
<%= if @address.hash == ExplorerWeb.TransactionView.to_address_hash(@transaction) do %> <%= if @address.hash == ExplorerWeb.TransactionView.to_address_hash(@transaction) do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction) %> <%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(@transaction.to_address), address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction) %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address), locale: @locale %>
<% end %> <% end %>
</span> </span>
<%= ExplorerWeb.TransactionView.value(@transaction, include_label: false) %> POA <%= ExplorerWeb.TransactionView.value(@transaction, include_label: false) %> POA

@ -162,13 +162,13 @@
</td> </td>
<td data-from-now="<%= transaction.block.timestamp %>"></td> <td data-from-now="<%= transaction.block.timestamp %>"></td>
<td class="address-cell"> <td class="address-cell">
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), address_hash: transaction.from_address_hash %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), locale: @locale %>
</td> </td>
<td class="u-text-center"><i class="fas fa-arrow-circle-right"></i></td> <td class="u-text-center"><i class="fas fa-arrow-circle-right"></i></td>
<td> <td>
<%= cond do %> <%= cond do %>
<% transaction.to_address_hash != nil -> %> <% transaction.to_address_hash != nil -> %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), address_hash: transaction.to_address_hash %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.to_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %>
<% transaction.created_contract_address_hash != nil -> %> <% transaction.created_contract_address_hash != nil -> %>
<i class="fas fa-plus-square"></i> <i class="fas fa-plus-square"></i>
<%= link( <%= link(

@ -11,9 +11,9 @@
<div class="col-md-7 col-lg-8 d-flex flex-column"> <div class="col-md-7 col-lg-8 d-flex flex-column">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %> <%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %>
<span> <span>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), address_hash: transaction.from_address_hash %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), locale: @locale %>
&rarr; &rarr;
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction) %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction), contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %>
</span> </span>
<%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA <%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA
</div> </div>

@ -1,14 +1,7 @@
<section class="container-fluid"> <section class="container">
<h1>
Transactions
</h1>
<p>
<%= gettext("Showing %{count} Pending Transactions", count: @pending_transaction_count) %>
</p>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<ul class="nav nav-tabs card-header-tabs"> <ul class="nav nav-tabs card-header-tabs d-none d-md-inline-flex">
<li class="nav-item"> <li class="nav-item">
<%= link( <%= link(
gettext("Validated"), gettext("Validated"),
@ -20,64 +13,53 @@
<%= link( <%= link(
gettext("Pending"), gettext("Pending"),
class: "nav-link active", class: "nav-link active",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index, @conn.assigns.locale) to: pending_transaction_path(@conn, :index, @conn.assigns.locale)
) %> ) %>
</li> </li>
</ul> </ul>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table table-responsive-sm table-font"> <h2 class="card-title mb-0"><%= gettext "Transactions" %></h2>
<thead> <p><%= gettext("Showing %{count} Pending Transactions", count: @pending_transaction_count) %></p>
<tr>
<th> <%= for transaction <- @transactions do %>
<%= gettext "Status" %> <div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-test="<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-transaction-hash="<%= transaction.hash %>">
</th> <div class="row" data-test="chain_transaction">
<th><%= gettext "Hash" %></th> <div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label">
<th><%= gettext "Last Seen" %></th> <%= ExplorerWeb.TransactionView.transaction_display_type(transaction) %>
<th><%= gettext "From" %></th> </div>
<th><%= gettext "To" %></th>
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> <div class="col-md-7 col-lg-8 d-flex flex-column">
</tr>
</thead>
<tbody>
<%= for transaction <- @transactions do %>
<tr data-transaction-hash="<%= transaction.hash %>">
<td>
<div class="transaction__dot transaction__dot--pending"></div>
</td>
<td>
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %> <%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %>
</td> <span>
<td data-from-now="<%= transaction.updated_at %>"></td> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), locale: @locale %>
<td> &rarr;
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), address_hash: transaction.from_address_hash %> <%= if transaction.to_address_hash do %>
</td> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.to_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %>
<td>
<%= if transaction.to_address_hash != nil do %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), address_hash: transaction.to_address_hash %>
<% else %> <% else %>
<%= gettext "Contract Creation" %> <%= gettext("Contract Address Pending") %>
<% end %> <% end %>
</td> </span>
<td> <%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA
<%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> </div>
</td> </div>
</tr> </div>
<% end %> <% end %>
</tbody> <%= if @next_page_params do %>
</table> <%= link(
gettext("Older"),
class: "button button--secondary button--sm float-right mt-3",
to: pending_transaction_path(
@conn,
:index,
@conn.assigns.locale,
@next_page_params
)
) %>
<% end %>
</div> </div>
</div> </div>
<%= if @next_page_params do %>
<%= link(
gettext("Older"),
class: "button button--secondary button--sm float-right mt-3",
to: pending_transaction_path(
@conn,
:index,
@conn.assigns.locale,
@next_page_params
)
) %>
<% end %>
</section> </section>

@ -1,14 +1,7 @@
<section class="container-fluid"> <section class="container">
<h1>
Transactions
</h1>
<p>
<%= gettext("Showing %{count} Validated Transactions", count: Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###")) %>
</p>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<ul class="nav nav-tabs card-header-tabs"> <ul class="nav nav-tabs card-header-tabs d-none d-md-inline-flex">
<li class="nav-item"> <li class="nav-item">
<%= link( <%= link(
gettext("Validated"), gettext("Validated"),
@ -20,81 +13,56 @@
<%= link( <%= link(
gettext("Pending"), gettext("Pending"),
class: "nav-link", class: "nav-link",
to: pending_transaction_path(@conn, :index, @conn.assigns.locale), "data-test": "pending_transactions_link",
"data-test": "pending_transactions_link" to: pending_transaction_path(@conn, :index, @conn.assigns.locale)
) %> ) %>
</li> </li>
</ul> </ul>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="table-responsive"> <h2 class="card-title mb-0"><%= gettext "Transactions" %></h2>
<table class="table table-font"> <p><%= gettext("Showing %{count} Validated Transactions", count: Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###")) %></p>
<thead>
<tr> <%= for transaction <- @transactions do %>
<th><%= gettext "Status" %></th> <div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-test="<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-transaction-hash="<%= transaction.hash %>">
<th><%= gettext "Hash" %></th> <div class="row" data-test="chain_transaction">
<th><%= gettext "Block" %></th> <div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label" data-test="transaction_type">
<th><%= gettext "Age" %></th> <%= ExplorerWeb.TransactionView.transaction_display_type(transaction) %>
<th><%= gettext "From" %></th> </div>
<th><%= gettext "To" %></th>
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> <div class="col-md-7 col-lg-8 d-flex flex-column">
</tr> <%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %>
</thead> <span>
<tbody> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), locale: @locale %>
<%= for transaction <- @transactions do %> &rarr;
<tr data-transaction-hash="<%= transaction.hash %>"> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction), contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %>
<td> </span>
<div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div> <%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA
</td> </div>
<td> <div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start justify-content-md-end text-md-right">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %> <span class="mr-2 mr-sm-0" data-from-now="<%= transaction.block.timestamp %>"></span>
</td> <%= link(
<td> gettext("Block #") <> "#{transaction.block.number}",
<%= link( to: block_path(@conn, :show, @conn.assigns.locale, transaction.block)
transaction.block_number, ) %>
class: "transactions__link", </div>
to: block_path(@conn, :show, @conn.assigns.locale, transaction.block) </div>
) %> </div>
</td> <% end %>
<td data-from-now="<%= transaction.block.timestamp %>"></td> <%= if @next_page_params do %>
<td> <%= link(
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), address_hash: transaction.from_address_hash %> gettext("Older"),
</td> class: "button button--secondary button--sm float-right mt-3",
<td> to: transaction_path(
<%= cond do %> @conn,
<% transaction.to_address_hash != nil -> %> :index,
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), address_hash: transaction.to_address_hash %> @conn.assigns.locale,
<% transaction.created_contract_address_hash != nil -> %> @next_page_params
<%= link( )
"Contract Creation", ) %>
class: "transaction__link", <% end %>
"data-address-hash": transaction.created_contract_address_hash,
to: address_path(@conn, :show, @conn.assigns.locale, transaction.created_contract_address_hash),
title: transaction.created_contract_address_hash
) %>
<% true -> %>
<% end %>
</td>
<td>
<%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div> </div>
</div> </div>
<%= if @next_page_params do %>
<%= link(
gettext("Older"),
class: "button button--secondary button--sm float-right mt-3",
to: transaction_path(
@conn,
:index,
@conn.assigns.locale,
@next_page_params
)
) %>
<% end %>
</section> </section>

@ -38,7 +38,7 @@
<tr> <tr>
<td><%= internal_transaction.type %></td> <td><%= internal_transaction.type %></td>
<td> <td>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(internal_transaction.from_address), address_hash: internal_transaction.from_address_hash %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(internal_transaction.from_address), locale: @locale %>
</td> </td>
<td> <td>
<%= if ExplorerWeb.InternalTransactionView.create?(internal_transaction) do %> <%= if ExplorerWeb.InternalTransactionView.create?(internal_transaction) do %>
@ -51,7 +51,7 @@
title: internal_transaction.created_contract_address_hash title: internal_transaction.created_contract_address_hash
) %> ) %>
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(internal_transaction.to_address), address_hash: internal_transaction.to_address_hash %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: internal_transaction.to_address_hash, contract: ExplorerWeb.AddressView.contract?(internal_transaction.to_address), locale: @locale %>
<% end %> <% end %>
</td> </td>
<td><%= ExplorerWeb.TransactionView.value(internal_transaction, include_label: false) %></td> <td><%= ExplorerWeb.TransactionView.value(internal_transaction, include_label: false) %></td>

@ -1,7 +1,7 @@
defmodule ExplorerWeb.AddressView do defmodule ExplorerWeb.AddressView do
use ExplorerWeb, :view use ExplorerWeb, :view
alias Explorer.Chain.{Address, Wei, SmartContract} alias Explorer.Chain.{Address, Hash, SmartContract, Wei}
alias Explorer.ExchangeRates.Token alias Explorer.ExchangeRates.Token
alias ExplorerWeb.ExchangeRates.USD alias ExplorerWeb.ExchangeRates.USD
@ -35,7 +35,7 @@ defmodule ExplorerWeb.AddressView do
def contract?(%Address{contract_code: _}), do: true def contract?(%Address{contract_code: _}), do: true
def contract?(_), do: false def contract?(nil), do: true
def formatted_usd(%Address{fetched_balance: nil}, _), do: nil def formatted_usd(%Address{fetched_balance: nil}, _), do: nil
@ -63,5 +63,13 @@ defmodule ExplorerWeb.AddressView do
end end
def smart_contract_verified?(%Address{smart_contract: %SmartContract{}}), do: true def smart_contract_verified?(%Address{smart_contract: %SmartContract{}}), do: true
def smart_contract_verified?(%Address{smart_contract: nil}), do: false def smart_contract_verified?(%Address{smart_contract: nil}), do: false
def trimmed_hash(%Hash{} = hash) do
string_hash = to_string(hash)
"#{String.slice(string_hash, 0..5)}#{String.slice(string_hash, -6..-1)}"
end
def trimmed_hash(_), do: ""
end end

@ -101,7 +101,7 @@ defmodule ExplorerWeb.TransactionView do
def type_suffix(%Transaction{} = transaction) do def type_suffix(%Transaction{} = transaction) do
cond do cond do
contract_creation?(transaction) -> "contract-creation" contract_creation?(transaction) -> "contract-creation"
involves_contract?(transaction) -> "contract" involves_contract?(transaction) -> "contract-call"
true -> "transaction" true -> "transaction"
end end
end end
@ -109,7 +109,7 @@ defmodule ExplorerWeb.TransactionView do
def transaction_display_type(%Transaction{} = transaction) do def transaction_display_type(%Transaction{} = transaction) do
cond do cond do
contract_creation?(transaction) -> gettext("Contract Creation") contract_creation?(transaction) -> gettext("Contract Creation")
involves_contract?(transaction) -> gettext("Contract") involves_contract?(transaction) -> gettext("Contract Call")
true -> gettext("Transaction") true -> gettext("Transaction")
end end
end end

@ -1,12 +1,10 @@
#: lib/explorer_web/templates/block/index.html.eex:18 #: lib/explorer_web/templates/block/index.html.eex:18
#: lib/explorer_web/templates/block_transaction/index.html.eex:141 #: lib/explorer_web/templates/block_transaction/index.html.eex:141
#: lib/explorer_web/templates/transaction/index.html.eex:37
#: lib/explorer_web/templates/transaction/overview.html.eex:51 #: lib/explorer_web/templates/transaction/overview.html.eex:51
msgid "Age" msgid "Age"
msgstr "" msgstr ""
#: lib/explorer_web/templates/block_transaction/index.html.eex:140 #: lib/explorer_web/templates/block_transaction/index.html.eex:140
#: lib/explorer_web/templates/transaction/index.html.eex:36
msgid "Block" msgid "Block"
msgstr "" msgstr ""
@ -28,8 +26,6 @@ msgstr ""
#: lib/explorer_web/templates/block_transaction/index.html.eex:30 #: lib/explorer_web/templates/block_transaction/index.html.eex:30
#: lib/explorer_web/templates/block_transaction/index.html.eex:139 #: lib/explorer_web/templates/block_transaction/index.html.eex:139
#: lib/explorer_web/templates/pending_transaction/index.html.eex:35
#: lib/explorer_web/templates/transaction/index.html.eex:35
msgid "Hash" msgid "Hash"
msgstr "" msgstr ""
@ -52,12 +48,12 @@ msgstr ""
#: lib/explorer_web/templates/block_transaction/index.html.eex:124 #: lib/explorer_web/templates/block_transaction/index.html.eex:124
#: lib/explorer_web/templates/chain/_transactions.html.eex:4 #: lib/explorer_web/templates/chain/_transactions.html.eex:4
#: lib/explorer_web/templates/layout/_topnav.html.eex:18 #: lib/explorer_web/templates/layout/_topnav.html.eex:18
#: lib/explorer_web/templates/pending_transaction/index.html.eex:24
#: lib/explorer_web/templates/transaction/index.html.eex:24
msgid "Transactions" msgid "Transactions"
msgstr "" msgstr ""
#: lib/explorer_web/templates/block_transaction/index.html.eex:145 #: lib/explorer_web/templates/block_transaction/index.html.eex:145
#: lib/explorer_web/templates/pending_transaction/index.html.eex:39
#: lib/explorer_web/templates/transaction/index.html.eex:40
#: lib/explorer_web/templates/transaction/overview.html.eex:63 #: lib/explorer_web/templates/transaction/overview.html.eex:63
#: lib/explorer_web/templates/transaction/overview.html.eex:71 #: lib/explorer_web/templates/transaction/overview.html.eex:71
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33
@ -149,8 +145,6 @@ msgstr ""
#: lib/explorer_web/templates/address_internal_transaction/index.html.eex:98 #: lib/explorer_web/templates/address_internal_transaction/index.html.eex:98
#: lib/explorer_web/templates/address_transaction/index.html.eex:109 #: lib/explorer_web/templates/address_transaction/index.html.eex:109
#: lib/explorer_web/templates/block_transaction/index.html.eex:142 #: lib/explorer_web/templates/block_transaction/index.html.eex:142
#: lib/explorer_web/templates/pending_transaction/index.html.eex:37
#: lib/explorer_web/templates/transaction/index.html.eex:38
#: lib/explorer_web/templates/transaction/overview.html.eex:79 #: lib/explorer_web/templates/transaction/overview.html.eex:79
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:31 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:31
#: lib/explorer_web/views/address_internal_transaction_view.ex:9 #: lib/explorer_web/views/address_internal_transaction_view.ex:9
@ -170,8 +164,6 @@ msgstr ""
#: lib/explorer_web/templates/address_internal_transaction/index.html.eex:86 #: lib/explorer_web/templates/address_internal_transaction/index.html.eex:86
#: lib/explorer_web/templates/address_transaction/index.html.eex:97 #: lib/explorer_web/templates/address_transaction/index.html.eex:97
#: lib/explorer_web/templates/block_transaction/index.html.eex:144 #: lib/explorer_web/templates/block_transaction/index.html.eex:144
#: lib/explorer_web/templates/pending_transaction/index.html.eex:38
#: lib/explorer_web/templates/transaction/index.html.eex:39
#: lib/explorer_web/templates/transaction/overview.html.eex:91 #: lib/explorer_web/templates/transaction/overview.html.eex:91
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:32 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:32
#: lib/explorer_web/views/address_internal_transaction_view.ex:8 #: lib/explorer_web/views/address_internal_transaction_view.ex:8
@ -215,8 +207,8 @@ msgstr ""
msgid "Showing %{count} Transactions" msgid "Showing %{count} Transactions"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:21 #: lib/explorer_web/templates/pending_transaction/index.html.eex:14
#: lib/explorer_web/templates/transaction/index.html.eex:21 #: lib/explorer_web/templates/transaction/index.html.eex:14
#: lib/explorer_web/templates/transaction/overview.html.eex:57 #: lib/explorer_web/templates/transaction/overview.html.eex:57
#: lib/explorer_web/views/transaction_view.ex:38 #: lib/explorer_web/views/transaction_view.ex:38
#: lib/explorer_web/views/transaction_view.ex:69 #: lib/explorer_web/views/transaction_view.ex:69
@ -227,7 +219,6 @@ msgstr ""
msgid "First Seen" msgid "First Seen"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:36
#: lib/explorer_web/templates/transaction/overview.html.eex:136 #: lib/explorer_web/templates/transaction/overview.html.eex:136
msgid "Last Seen" msgid "Last Seen"
msgstr "" msgstr ""
@ -237,7 +228,7 @@ msgstr ""
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:6 #: lib/explorer_web/templates/pending_transaction/index.html.eex:25
msgid "Showing %{count} Pending Transactions" msgid "Showing %{count} Pending Transactions"
msgstr "" msgstr ""
@ -290,8 +281,6 @@ msgid "Out of Gas"
msgstr "" msgstr ""
#: lib/explorer_web/templates/block_transaction/index.html.eex:137 #: lib/explorer_web/templates/block_transaction/index.html.eex:137
#: lib/explorer_web/templates/pending_transaction/index.html.eex:33
#: lib/explorer_web/templates/transaction/index.html.eex:34
msgid "Status" msgid "Status"
msgstr "" msgstr ""
@ -304,8 +293,6 @@ msgid "Showing #%{number}"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address/_values.html.eex:4 #: lib/explorer_web/templates/address/_values.html.eex:4
#: lib/explorer_web/templates/pending_transaction/index.html.eex:39
#: lib/explorer_web/templates/transaction/index.html.eex:40
#: lib/explorer_web/templates/transaction/overview.html.eex:63 #: lib/explorer_web/templates/transaction/overview.html.eex:63
#: lib/explorer_web/templates/transaction/overview.html.eex:159 #: lib/explorer_web/templates/transaction/overview.html.eex:159
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33
@ -372,8 +359,8 @@ msgstr ""
msgid "Fee" msgid "Fee"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:14 #: lib/explorer_web/templates/pending_transaction/index.html.eex:7
#: lib/explorer_web/templates/transaction/index.html.eex:14 #: lib/explorer_web/templates/transaction/index.html.eex:7
msgid "Validated" msgid "Validated"
msgstr "" msgstr ""
@ -416,7 +403,7 @@ msgstr ""
msgid "Dashboard" msgid "Dashboard"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/index.html.eex:6 #: lib/explorer_web/templates/transaction/index.html.eex:25
msgid "Showing %{count} Validated Transactions" msgid "Showing %{count} Validated Transactions"
msgstr "" msgstr ""
@ -483,8 +470,8 @@ msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:138 #: lib/explorer_web/templates/address_transaction/index.html.eex:138
#: lib/explorer_web/templates/block/index.html.eex:60 #: lib/explorer_web/templates/block/index.html.eex:60
#: lib/explorer_web/templates/block_transaction/index.html.eex:198 #: lib/explorer_web/templates/block_transaction/index.html.eex:198
#: lib/explorer_web/templates/pending_transaction/index.html.eex:73 #: lib/explorer_web/templates/pending_transaction/index.html.eex:52
#: lib/explorer_web/templates/transaction/index.html.eex:90 #: lib/explorer_web/templates/transaction/index.html.eex:55
msgid "Older" msgid "Older"
msgstr "" msgstr ""
@ -523,7 +510,6 @@ msgid "Newer"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/explorer_web/templates/pending_transaction/index.html.eex:59
#: lib/explorer_web/templates/transaction/overview.html.eex:109 #: lib/explorer_web/templates/transaction/overview.html.eex:109
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:47 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:47
#: lib/explorer_web/views/transaction_view.ex:111 #: lib/explorer_web/views/transaction_view.ex:111
@ -568,6 +554,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/explorer_web/templates/address_transaction/_transaction.html.eex:31 #: lib/explorer_web/templates/address_transaction/_transaction.html.eex:31
#: lib/explorer_web/templates/chain/_transactions.html.eex:23 #: lib/explorer_web/templates/chain/_transactions.html.eex:23
#: lib/explorer_web/templates/transaction/index.html.eex:46
msgid "Block #" msgid "Block #"
msgstr "" msgstr ""
@ -636,3 +623,13 @@ msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:131 #: lib/explorer_web/templates/address_transaction/index.html.eex:131
msgid "There are no transactions for this address." msgid "There are no transactions for this address."
msgstr "" msgstr ""
#, elixir-format
#: lib/explorer_web/templates/pending_transaction/index.html.eex:42
msgid "Contract Address Pending"
msgstr ""
#, elixir-format
#: lib/explorer_web/views/transaction_view.ex:112
msgid "Contract Call"
msgstr ""

@ -12,13 +12,11 @@ msgstr ""
#: lib/explorer_web/templates/block/index.html.eex:18 #: lib/explorer_web/templates/block/index.html.eex:18
#: lib/explorer_web/templates/block_transaction/index.html.eex:141 #: lib/explorer_web/templates/block_transaction/index.html.eex:141
#: lib/explorer_web/templates/transaction/index.html.eex:37
#: lib/explorer_web/templates/transaction/overview.html.eex:51 #: lib/explorer_web/templates/transaction/overview.html.eex:51
msgid "Age" msgid "Age"
msgstr "Age" msgstr "Age"
#: lib/explorer_web/templates/block_transaction/index.html.eex:140 #: lib/explorer_web/templates/block_transaction/index.html.eex:140
#: lib/explorer_web/templates/transaction/index.html.eex:36
msgid "Block" msgid "Block"
msgstr "Block" msgstr "Block"
@ -40,8 +38,6 @@ msgstr "Gas Used"
#: lib/explorer_web/templates/block_transaction/index.html.eex:30 #: lib/explorer_web/templates/block_transaction/index.html.eex:30
#: lib/explorer_web/templates/block_transaction/index.html.eex:139 #: lib/explorer_web/templates/block_transaction/index.html.eex:139
#: lib/explorer_web/templates/pending_transaction/index.html.eex:35
#: lib/explorer_web/templates/transaction/index.html.eex:35
msgid "Hash" msgid "Hash"
msgstr "Hash" msgstr "Hash"
@ -64,12 +60,12 @@ msgstr "POA Network Explorer"
#: lib/explorer_web/templates/block_transaction/index.html.eex:124 #: lib/explorer_web/templates/block_transaction/index.html.eex:124
#: lib/explorer_web/templates/chain/_transactions.html.eex:4 #: lib/explorer_web/templates/chain/_transactions.html.eex:4
#: lib/explorer_web/templates/layout/_topnav.html.eex:18 #: lib/explorer_web/templates/layout/_topnav.html.eex:18
#: lib/explorer_web/templates/pending_transaction/index.html.eex:24
#: lib/explorer_web/templates/transaction/index.html.eex:24
msgid "Transactions" msgid "Transactions"
msgstr "Transactions" msgstr "Transactions"
#: lib/explorer_web/templates/block_transaction/index.html.eex:145 #: lib/explorer_web/templates/block_transaction/index.html.eex:145
#: lib/explorer_web/templates/pending_transaction/index.html.eex:39
#: lib/explorer_web/templates/transaction/index.html.eex:40
#: lib/explorer_web/templates/transaction/overview.html.eex:63 #: lib/explorer_web/templates/transaction/overview.html.eex:63
#: lib/explorer_web/templates/transaction/overview.html.eex:71 #: lib/explorer_web/templates/transaction/overview.html.eex:71
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33
@ -161,8 +157,6 @@ msgstr "Address"
#: lib/explorer_web/templates/address_internal_transaction/index.html.eex:98 #: lib/explorer_web/templates/address_internal_transaction/index.html.eex:98
#: lib/explorer_web/templates/address_transaction/index.html.eex:109 #: lib/explorer_web/templates/address_transaction/index.html.eex:109
#: lib/explorer_web/templates/block_transaction/index.html.eex:142 #: lib/explorer_web/templates/block_transaction/index.html.eex:142
#: lib/explorer_web/templates/pending_transaction/index.html.eex:37
#: lib/explorer_web/templates/transaction/index.html.eex:38
#: lib/explorer_web/templates/transaction/overview.html.eex:79 #: lib/explorer_web/templates/transaction/overview.html.eex:79
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:31 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:31
#: lib/explorer_web/views/address_internal_transaction_view.ex:9 #: lib/explorer_web/views/address_internal_transaction_view.ex:9
@ -182,8 +176,6 @@ msgstr "Success"
#: lib/explorer_web/templates/address_internal_transaction/index.html.eex:86 #: lib/explorer_web/templates/address_internal_transaction/index.html.eex:86
#: lib/explorer_web/templates/address_transaction/index.html.eex:97 #: lib/explorer_web/templates/address_transaction/index.html.eex:97
#: lib/explorer_web/templates/block_transaction/index.html.eex:144 #: lib/explorer_web/templates/block_transaction/index.html.eex:144
#: lib/explorer_web/templates/pending_transaction/index.html.eex:38
#: lib/explorer_web/templates/transaction/index.html.eex:39
#: lib/explorer_web/templates/transaction/overview.html.eex:91 #: lib/explorer_web/templates/transaction/overview.html.eex:91
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:32 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:32
#: lib/explorer_web/views/address_internal_transaction_view.ex:8 #: lib/explorer_web/views/address_internal_transaction_view.ex:8
@ -227,8 +219,8 @@ 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_web/templates/pending_transaction/index.html.eex:21 #: lib/explorer_web/templates/pending_transaction/index.html.eex:14
#: lib/explorer_web/templates/transaction/index.html.eex:21 #: lib/explorer_web/templates/transaction/index.html.eex:14
#: lib/explorer_web/templates/transaction/overview.html.eex:57 #: lib/explorer_web/templates/transaction/overview.html.eex:57
#: lib/explorer_web/views/transaction_view.ex:38 #: lib/explorer_web/views/transaction_view.ex:38
#: lib/explorer_web/views/transaction_view.ex:69 #: lib/explorer_web/views/transaction_view.ex:69
@ -239,7 +231,6 @@ msgstr "Pending"
msgid "First Seen" msgid "First Seen"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:36
#: lib/explorer_web/templates/transaction/overview.html.eex:136 #: lib/explorer_web/templates/transaction/overview.html.eex:136
msgid "Last Seen" msgid "Last Seen"
msgstr "" msgstr ""
@ -249,7 +240,7 @@ msgstr ""
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:6 #: lib/explorer_web/templates/pending_transaction/index.html.eex:25
msgid "Showing %{count} Pending Transactions" msgid "Showing %{count} Pending Transactions"
msgstr "" msgstr ""
@ -302,8 +293,6 @@ msgid "Out of Gas"
msgstr "" msgstr ""
#: lib/explorer_web/templates/block_transaction/index.html.eex:137 #: lib/explorer_web/templates/block_transaction/index.html.eex:137
#: lib/explorer_web/templates/pending_transaction/index.html.eex:33
#: lib/explorer_web/templates/transaction/index.html.eex:34
msgid "Status" msgid "Status"
msgstr "" msgstr ""
@ -316,8 +305,6 @@ msgid "Showing #%{number}"
msgstr "" msgstr ""
#: lib/explorer_web/templates/address/_values.html.eex:4 #: lib/explorer_web/templates/address/_values.html.eex:4
#: lib/explorer_web/templates/pending_transaction/index.html.eex:39
#: lib/explorer_web/templates/transaction/index.html.eex:40
#: lib/explorer_web/templates/transaction/overview.html.eex:63 #: lib/explorer_web/templates/transaction/overview.html.eex:63
#: lib/explorer_web/templates/transaction/overview.html.eex:159 #: lib/explorer_web/templates/transaction/overview.html.eex:159
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:33
@ -384,8 +371,8 @@ msgstr ""
msgid "Fee" msgid "Fee"
msgstr "" msgstr ""
#: lib/explorer_web/templates/pending_transaction/index.html.eex:14 #: lib/explorer_web/templates/pending_transaction/index.html.eex:7
#: lib/explorer_web/templates/transaction/index.html.eex:14 #: lib/explorer_web/templates/transaction/index.html.eex:7
msgid "Validated" msgid "Validated"
msgstr "" msgstr ""
@ -428,7 +415,7 @@ msgstr ""
msgid "Dashboard" msgid "Dashboard"
msgstr "" msgstr ""
#: lib/explorer_web/templates/transaction/index.html.eex:6 #: lib/explorer_web/templates/transaction/index.html.eex:25
msgid "Showing %{count} Validated Transactions" msgid "Showing %{count} Validated Transactions"
msgstr "" msgstr ""
@ -495,8 +482,8 @@ msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:138 #: lib/explorer_web/templates/address_transaction/index.html.eex:138
#: lib/explorer_web/templates/block/index.html.eex:60 #: lib/explorer_web/templates/block/index.html.eex:60
#: lib/explorer_web/templates/block_transaction/index.html.eex:198 #: lib/explorer_web/templates/block_transaction/index.html.eex:198
#: lib/explorer_web/templates/pending_transaction/index.html.eex:73 #: lib/explorer_web/templates/pending_transaction/index.html.eex:52
#: lib/explorer_web/templates/transaction/index.html.eex:90 #: lib/explorer_web/templates/transaction/index.html.eex:55
msgid "Older" msgid "Older"
msgstr "" msgstr ""
@ -535,7 +522,6 @@ msgid "Newer"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/explorer_web/templates/pending_transaction/index.html.eex:59
#: lib/explorer_web/templates/transaction/overview.html.eex:109 #: lib/explorer_web/templates/transaction/overview.html.eex:109
#: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:47 #: lib/explorer_web/templates/transaction_internal_transaction/index.html.eex:47
#: lib/explorer_web/views/transaction_view.ex:111 #: lib/explorer_web/views/transaction_view.ex:111
@ -580,6 +566,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/explorer_web/templates/address_transaction/_transaction.html.eex:31 #: lib/explorer_web/templates/address_transaction/_transaction.html.eex:31
#: lib/explorer_web/templates/chain/_transactions.html.eex:23 #: lib/explorer_web/templates/chain/_transactions.html.eex:23
#: lib/explorer_web/templates/transaction/index.html.eex:46
msgid "Block #" msgid "Block #"
msgstr "" msgstr ""
@ -613,7 +600,7 @@ msgstr ""
msgid "block confirmations" msgid "block confirmations"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/explorer_web/templates/address_transaction/index.html.eex:81 #: lib/explorer_web/templates/address_transaction/index.html.eex:81
msgid "Connection Lost, click to load newer transactions" msgid "Connection Lost, click to load newer transactions"
msgstr "" msgstr ""
@ -629,7 +616,7 @@ msgstr ""
msgid "Internal Transaction" msgid "Internal Transaction"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/explorer_web/templates/address_transaction/index.html.eex:76 #: lib/explorer_web/templates/address_transaction/index.html.eex:76
msgid "More messages have come in" msgid "More messages have come in"
msgstr "" msgstr ""
@ -648,3 +635,13 @@ msgstr ""
#: lib/explorer_web/templates/address_transaction/index.html.eex:131 #: lib/explorer_web/templates/address_transaction/index.html.eex:131
msgid "There are no transactions for this address." msgid "There are no transactions for this address."
msgstr "" msgstr ""
#, elixir-format
#: lib/explorer_web/templates/pending_transaction/index.html.eex:42
msgid "Contract Address Pending"
msgstr ""
#, elixir-format
#: lib/explorer_web/views/transaction_view.ex:112
msgid "Contract Call"
msgstr ""

@ -5,7 +5,7 @@ defmodule ExplorerWeb.TransactionListPage do
import Wallaby.Query, only: [css: 1, css: 2] import Wallaby.Query, only: [css: 1, css: 2]
alias Explorer.Chain.{InternalTransaction, Transaction} alias Explorer.Chain.Transaction
def click_transaction(session, %Transaction{hash: transaction_hash}) do def click_transaction(session, %Transaction{hash: transaction_hash}) do
click(session, css("[data-transaction-hash='#{transaction_hash}'] [data-test='transaction_hash_link']")) click(session, css("[data-transaction-hash='#{transaction_hash}'] [data-test='transaction_hash_link']"))
@ -15,8 +15,8 @@ defmodule ExplorerWeb.TransactionListPage do
click(session, css("[data-test='pending_transactions_link']")) click(session, css("[data-test='pending_transactions_link']"))
end end
def contract_creation(%InternalTransaction{created_contract_address_hash: hash}) do def contract_creation(%Transaction{hash: hash}) do
css("[data-address-hash='#{hash}']", text: "Contract Creation") css("[data-transaction-hash='#{hash}'] [data-test='transaction_type']", text: "Contract Creation")
end end
def transaction(%Transaction{hash: transaction_hash}) do def transaction(%Transaction{hash: transaction_hash}) do

@ -111,11 +111,11 @@ defmodule ExplorerWeb.ViewingTransactionsTest do
|> insert(to_address: nil) |> insert(to_address: nil)
|> with_block() |> with_block()
internal_transaction = insert(:internal_transaction_create, transaction: transaction, index: 0) insert(:internal_transaction_create, transaction: transaction, index: 0)
session session
|> TransactionListPage.visit_page() |> TransactionListPage.visit_page()
|> assert_has(TransactionListPage.contract_creation(internal_transaction)) |> assert_has(TransactionListPage.contract_creation(transaction))
end end
end end

Loading…
Cancel
Save