Only display the number of validations if it's a validator.

pull/893/head
Lokraan 6 years ago
parent 4c3ee49eb3
commit 697ce5269f
  1. 2
      apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex
  2. 6
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex

@ -19,7 +19,7 @@
</span> <%= gettext "Transactions sent" %>
<% if validator?(@address) do %>
<span data-test="validation_count">
<%= validation_count(@address) %>
<%= @validation_count %>
</span> <%= gettext "Validations" %>
<% end %>
</span>

@ -116,8 +116,6 @@ defmodule BlockScoutWeb.AddressView do
def validator?(val) when val > 0, do: true
def validator?(%Address{} = address), do: Chain.address_to_validation_count(address)
def validator?(_), do: false
def hash(%Address{hash: hash}) do
@ -166,7 +164,9 @@ defmodule BlockScoutWeb.AddressView do
end
def validation_count(%Address{} = address) do
Chain.address_to_validation_count(address)
count = Chain.address_to_validation_count(address)
IO.puts "Got validation count: #{count}"
count
end
def trimmed_hash(%Hash{} = hash) do

Loading…
Cancel
Save