@ -8,7 +8,7 @@
<%= gettext("%{block_type} Details", block_type: block_type(@block)) %>
<%= gettext("%{block_type} Details", block_type: block_type(@block)) %>
</h1>
</h1>
<!-- Block Height -->
<!-- Block Height -->
<h3 data-test="block_detail_number">
<h3 class="block-detail-number" data-test="block_detail_number" data-toggle="tooltip" data-placement="top" title="" data-original-title="The block number in which transactions were recorded." >
<%= if block_type(@block) == "Block" do %>
<%= if block_type(@block) == "Block" do %>
<%= gettext("Block Height: %{height}", height: @block.number) %> <%= if @block.number == 0, do: "- " <> gettext("Genesis Block")%>
<%= gettext("Block Height: %{height}", height: @block.number) %> <%= if @block.number == 0, do: "- " <> gettext("Genesis Block")%>
<% else %>
<% else %>
@ -19,24 +19,19 @@
<div class="d-flex justify-content-start text-muted block-details-row">
<div class="d-flex justify-content-start text-muted block-details-row">
<!-- # of Transactions -->
<!-- # of Transactions -->
<span class="mr-4 block-detail-el"> <%= gettext "%{count} Transactions", count: @block_transaction_count %> </span>
<span class="mr-4 block-detail-el"> <%= gettext "%{count} Transactions", count: @block_transaction_count %> </span>
<%= if @block.size do %>
<%= if @block.size do %>
<!-- Block Size -->
<!-- Block Size -->
<span class="mr-4 block-detail-el"> <%= Cldr.Unit.new(:byte, @block.size) |> cldr_unit_to_string!() %> </span>
<span class="mr-4 block-detail-el"> <%= Cldr.Unit.new(:byte, @block.size) |> cldr_unit_to_string!() %> </span>
<% end %>
<% end %>
<!-- Block Age -->
<!-- Block Age -->
<span class="mr-4 block-detail-el" data-from-now="<%= @block.timestamp %>"></span>
<span class="mr-4 block-detail-el" data-from-now="<%= @block.timestamp %>"></span>
</div>
</div>
<hr>
<hr>
<!-- Block details description list -->
<!-- Block details description list -->
<!-- Block Hash -->
<!-- Block Hash -->
<dl class="row">
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Hash" %></dt>
<dt class="col-sm-3 text-muted"><%= gettext "Hash" %></dt>
<dd class="col-sm-9"><a class="transaction__link"><%= to_string(@block.hash) %></a></dd>
<dd class="col-sm-9"><a class="transaction__link" data-toggle="tooltip" data-placement="top" title="" data-original-title="The SHA256 hash of the block." ><%= to_string(@block.hash) %></a></dd>
</dl>
</dl>
<%= unless @block.number == 0 do %>
<%= unless @block.number == 0 do %>
@ -44,11 +39,13 @@
<dl class="row">
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Parent Hash" %></dt>
<dt class="col-sm-3 text-muted"><%= gettext "Parent Hash" %></dt>
<dd class="col-sm-9">
<dd class="col-sm-9">
<span data-toggle="tooltip" data-placement="top" title="" data-original-title="The SHA256 hash of the parent block." >
<%= link(
<%= link(
@block.parent_hash,
@block.parent_hash,
class: "transaction__link",
class: "transaction__link",
to: block_path(@conn, :show, @block.number - 1)
to: block_path(@conn, :show, @block.number - 1)
) %>
) %>
</span>
</dd>
</dd>
</dl>
</dl>
<% end %>
<% end %>
@ -56,8 +53,8 @@
<!-- Difficulty value -->
<!-- Difficulty value -->
<dl class="row">
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Difficulty" %></dt>
<dt class="col-sm-3 text-muted"><%= gettext "Difficulty" %></dt>
<dd class="col-sm-9">
<dd class="col-sm-9" >
<span><%= @block.difficulty |> BlockScoutWeb.Cldr.Number.to_string! %></span>
<span data-toggle="tooltip" data-placement="top" title="" data-original-title="Block difficulty for miner, used to calibrate block generation time (Note: constant in POA based networks)." ><%= @block.difficulty |> BlockScoutWeb.Cldr.Number.to_string! %></span>
</dd>
</dd>
</dl>
</dl>
@ -65,13 +62,13 @@
<!-- Total Difficulty -->
<!-- Total Difficulty -->
<dl class="row">
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Total Difficulty" %></dt>
<dt class="col-sm-3 text-muted"><%= gettext "Total Difficulty" %></dt>
<dd class="col-sm-9"><span><%= @block.total_difficulty |> BlockScoutWeb.Cldr.Number.to_string! %></span></dd>
<dd class="col-sm-9"><span data-toggle="tooltip" data-placement="top" title="" data-original-title="Integer of the total difficulty of the chain until this block." ><%= @block.total_difficulty |> BlockScoutWeb.Cldr.Number.to_string! %></span></dd>
</dl>
</dl>
<!-- Nonce -->
<!-- Nonce -->
<dl class="row">
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Nonce" %></dt>
<dt class="col-sm-3 text-muted"><%= gettext "Nonce" %></dt>
<dd class="col-sm-9"><span><%= to_string(@block.nonce) %></span></dd>
<dd class="col-sm-9"><span data-toggle="tooltip" data-placement="top" title="" data-original-title="64-bit hash of value verifying proof-of-work (note: null for POA chains)." ><%= to_string(@block.nonce) %></span></dd>
</dl>
</dl>
<%= if length(@block.uncle_relations) > 0 do %>
<%= if length(@block.uncle_relations) > 0 do %>
@ -83,6 +80,9 @@
<%= link(
<%= link(
gettext("Position %{index}", index: index),
gettext("Position %{index}", index: index),
class: "transaction__link",
class: "transaction__link",
"data-toggle": "tooltip",
"data-placement": "top" ,
"data-original-title": "Index position(s) of referenced stale blocks." ,
"data-test": "uncle_link",
"data-test": "uncle_link",
"data-uncle-hash": to_string(relation.uncle_hash),
"data-uncle-hash": to_string(relation.uncle_hash),
to: block_path(@conn, :show, relation.uncle_hash)
to: block_path(@conn, :show, relation.uncle_hash)
@ -91,20 +91,19 @@
</dd>
</dd>
</dl>
</dl>
<% end %>
<% end %>
<!-- Otherwise it will be displayed in its own block -->
<!-- Otherwise it will be displayed in its own block -->
<%= if show_reward?(@block.rewards) do %>
<%= if show_reward?(@block.rewards) do %>
<dl class="row">
<dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Gas Used" %></dt>
<dt class="col-sm-3 text-muted"><%= gettext "Gas Used" %></dt>
<dd class="col-sm-9">
<dd class="col-sm-9">
<span><%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %></span>
<span data-toggle="tooltip" data-placement="top" title="" data-original-title="Total gas used by all transactions in this block (limit)." ><%= @block.gas_used |> BlockScoutWeb.Cldr.Number.to_string! %></span>
<span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
<span class="text-muted" data-toggle="tooltip" data-placement="top" title="" data-original-title="Total gas used by all transactions in this block (% used)." >(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
</dt>
</dt>
</dl>
</dl>
<dl class="row mb-0">
<dl class="row mb-0">
<dt class="col-sm-3 text-muted"><%= gettext "Gas Limit" %></dt>
<dt class="col-sm-3 text-muted"><%= gettext "Gas Limit" %></dt>
<dd class="col-sm-9">
<dd class="col-sm-9">
<span><%= BlockScoutWeb.Cldr.Number.to_string!(@block.gas_limit) %></span>
<span data-toggle="tooltip" data-placement="top" title="" data-original-title="The maximum gas allowed in this block." ><%= BlockScoutWeb.Cldr.Number.to_string!(@block.gas_limit) %></span>
</dd>
</dd>
</dl>
</dl>
<% end %>
<% end %>
@ -119,9 +118,12 @@
<div class="card card-background-1 flex-grow-1">
<div class="card card-background-1 flex-grow-1">
<div class="card-body card-body-flex-column-space-between">
<div class="card-body card-body-flex-column-space-between">
<h2 class="card-title balance-card-title"><%= gettext "Miner" %></h2>
<h2 class="card-title balance-card-title"><%= gettext "Miner" %></h2>
<div class="text-right">
<div class="text-right tooltipCustom ">
<!-- Validator's Name -->
<!-- Validator's Name -->
<h3 class="address-balance-text text-truncate">
<span class="tooltiptextTopMiner"> Validator's Name</span>
<h3 class="address-balance-text text-truncate" >
<%= render BlockScoutWeb.AddressView,
<%= render BlockScoutWeb.AddressView,
"_link.html",
"_link.html",
address: @block.miner,
address: @block.miner,
@ -133,13 +135,17 @@
</div>
</div>
<!-- Validator Reward or Gas-->
<!-- Validator Reward or Gas-->
<div class="card flex-grow-1 ml-0 ml-md-5 ml-lg-0">
<div class="card flex-grow-1 ml-0 ml-md-5 ml-lg-0" >
<div class="card-body card-body-flex-column-space-between">
<div class="card-body card-body-flex-column-space-between">
<%= if show_reward?(@block.rewards) do %>
<%= if show_reward?(@block.rewards) do %>
<h2 class="card-title balance-card-title"><%= gettext "Block Rewards" %></h2>
<h2 class="card-title balance-card-title"><%= gettext "Block Rewards" %></h2>
<div class="text-right">
<div class="text-right" style="margin-left: 50%;" data-toggle="tooltip" data-placement="top" title="" data-original-title="Amount of distributed reward. Miners receive a static block reward + Tx fees + uncle fees.">
<%= for block_reward <- @block.rewards do %>
<%= for block_reward <- @block.rewards do %>
<p class="address-current-balance"><%= block_reward_text(block_reward) %> <span class="text-muted"><%= format_wei_value(block_reward.reward, :ether) %></span></p>
<p class="address-current-balance "><%= block_reward_text(block_reward) %> <span class="text-muted"><%= format_wei_value(block_reward.reward, :ether) %></span></p>
<% end %>
<% end %>
</div>
</div>
<% else %>
<% else %>
@ -150,6 +156,7 @@
<span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
<span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> BlockScoutWeb.Cldr.Number.to_string!(format: "#.#%") %>)</span>
</h3>
</h3>
<p class="address-current-balance"><%= @block.gas_limit |> BlockScoutWeb.Cldr.Number.to_string! %><%= gettext "Gas Limit" %></p>
<p class="address-current-balance"><%= @block.gas_limit |> BlockScoutWeb.Cldr.Number.to_string! %><%= gettext "Gas Limit" %></p>
</div>
</div>
<% end %>
<% end %>
</div>
</div>