-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2145 from IntersectMBO/fix/2000--ada-holder-votin…
…g-power-does-not-take-into-account-unclaimed-rewards-or-gov-action-deposits-paid fix(#2000): fix counting ada holder voting power
- Loading branch information
Showing
2 changed files
with
9 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
select coalesce(sum(utxo_view.value), 0), encode(stake_address.hash_raw, 'hex') | ||
from stake_address | ||
join utxo_view | ||
on utxo_view.stake_address_id = stake_address.id | ||
where stake_address.hash_raw = decode(?, 'hex') | ||
group by stake_address.hash_raw | ||
SELECT COALESCE(SUM(utxo_view.value::numeric), 0) + COALESCE(SUM(reward_rest.amount), 0) AS total_value, | ||
encode(stake_address.hash_raw, 'hex') | ||
FROM stake_address | ||
JOIN utxo_view ON utxo_view.stake_address_id = stake_address.id | ||
LEFT JOIN reward_rest ON reward_rest.addr_id = stake_address.id | ||
WHERE reward_rest.earned_epoch IS NULL | ||
WHERE stake_address.hash_raw = decode(?, 'hex') | ||
GROUP BY stake_address.hash_raw; |