|
|
@ -6319,7 +6319,9 @@ defmodule Explorer.Chain do |
|
|
|
) |
|
|
|
) |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def get_total_staked_and_ordered(address_hash) do |
|
|
|
def get_total_staked_and_ordered(""), do: nil |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_total_staked_and_ordered(address_hash) when is_binary(address_hash) do |
|
|
|
StakingPoolsDelegator |
|
|
|
StakingPoolsDelegator |
|
|
|
|> where([delegator], delegator.address_hash == ^address_hash and not delegator.is_deleted) |
|
|
|
|> where([delegator], delegator.address_hash == ^address_hash and not delegator.is_deleted) |
|
|
|
|> select([delegator], %{ |
|
|
|
|> select([delegator], %{ |
|
|
@ -6329,6 +6331,8 @@ defmodule Explorer.Chain do |
|
|
|
|> Repo.one() |
|
|
|
|> Repo.one() |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def get_total_staked_and_ordered(_), do: nil |
|
|
|
|
|
|
|
|
|
|
|
defp with_decompiled_code_flag(query, _hash, false), do: query |
|
|
|
defp with_decompiled_code_flag(query, _hash, false), do: query |
|
|
|
|
|
|
|
|
|
|
|
defp with_decompiled_code_flag(query, hash, true) do |
|
|
|
defp with_decompiled_code_flag(query, hash, true) do |
|
|
|