diff --git a/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex b/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex index 4045608014..7c11511d6d 100644 --- a/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex +++ b/apps/block_scout_web/lib/block_scout_web/channels/stakes_channel.ex @@ -62,7 +62,7 @@ defmodule BlockScoutWeb.StakesChannel do pool_staking_address |> Chain.staking_pool_delegators() |> Enum.sort_by(fn staker -> - staker_address = to_string(staker.delegator_address_hash) + staker_address = to_string(staker.address_hash) cond do staker_address == pool_staking_address -> 0 @@ -148,7 +148,7 @@ defmodule BlockScoutWeb.StakesChannel do token = ContractState.get(:token) min_from_stake = - if delegator_from.delegator_address_hash == delegator_from.pool_address_hash do + if delegator_from.address_hash == delegator_from.staking_address_hash do ContractState.get(:min_candidate_stake) else ContractState.get(:min_delegator_stake) @@ -201,7 +201,7 @@ defmodule BlockScoutWeb.StakesChannel do delegator = Chain.staking_pool_delegator(staking_address, socket.assigns.account) min_stake = - if delegator.delegator_address_hash == delegator.pool_address_hash do + if delegator.address_hash == delegator.staking_address_hash do ContractState.get(:min_candidate_stake) else ContractState.get(:min_delegator_stake) diff --git a/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex b/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex index f28519102f..6ca15827e9 100644 --- a/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex +++ b/apps/block_scout_web/lib/block_scout_web/controllers/stakes_controller.ex @@ -25,7 +25,7 @@ defmodule BlockScoutWeb.StakesController do account = if account_address = conn.assigns[:account] do account_address - |> Chain.get_total_staked() + |> Chain.get_total_staked_and_ordered() |> Map.merge(%{ address: account_address, balance: Chain.fetch_last_token_balance(account_address, token.contract_address_hash), @@ -141,7 +141,7 @@ defmodule BlockScoutWeb.StakesController do end defp stake_allowed?(pool, delegator) do - Decimal.positive?(pool.self_staked_amount) or delegator.delegator_address_hash == pool.staking_address_hash + Decimal.positive?(pool.self_staked_amount) or delegator.address_hash == pool.staking_address_hash end defp move_allowed?(nil), do: false diff --git a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex index 8ac2afb7c7..2aa0b50325 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_rows.html.eex @@ -36,7 +36,7 @@ <%= gettext("Banned until block #%{banned_until} (%{estimated_unban_day})", banned_until: @pool.banned_until, estimated_unban_day: estimated_unban_day(@pool.banned_until, @average_block_time)) %> <%= if @delegator && - @delegator.delegator_address_hash != @pool.staking_address_hash && + @delegator.address_hash != @pool.staking_address_hash && @pool.are_delegators_banned && @pool.banned_until != @pool.banned_delegators_until do %> <%= raw(".
") %> @@ -47,7 +47,7 @@ <%= if !@pool.is_banned || (!@pool.are_delegators_banned && @delegator && - @delegator.delegator_address_hash != @pool.staking_address_hash + @delegator.address_hash != @pool.staking_address_hash ) do %>
<%= if @buttons.move do %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex index 61b0e3f3df..bb9824bf7b 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex @@ -63,13 +63,13 @@ <%= link( - BlockScoutWeb.AddressView.trimmed_hash(staker.delegator_address_hash), - to: address_path(@conn, :show, staker.delegator_address_hash), + BlockScoutWeb.AddressView.trimmed_hash(staker.address_hash), + to: address_path(@conn, :show, staker.address_hash), target: "_blank" ) %> - <%= if staker.delegator_address_hash == @pool.staking_address_hash do %> + <%= if staker.address_hash == @pool.staking_address_hash do %> <%= render( BlockScoutWeb.CommonComponentsView, @@ -78,7 +78,7 @@ ) %> <% end %> - <%= if to_string(staker.delegator_address_hash) == @account do %> + <%= if to_string(staker.address_hash) == @account do %>
<% reward = - if staker.delegator_address_hash == @pool.staking_address_hash do + if staker.address_hash == @pool.staking_address_hash do %{ reward_ratio: @pool.validator_reward_ratio, snapshotted_reward_ratio: @pool.snapshotted_validator_reward_ratio diff --git a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_move.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_move.html.eex index 7283a66111..84cc730e97 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_move.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_move.html.eex @@ -22,7 +22,7 @@ <%= for %{pool: pool} <- @pools, pool.staking_address_hash != @pool_from.staking_address_hash, - Decimal.positive?(pool.self_staked_amount) or pool.staking_address_hash == @delegator_from.delegator_address_hash do %> + Decimal.positive?(pool.self_staked_amount) or pool.staking_address_hash == @delegator_from.address_hash do %>