File tree Expand file tree Collapse file tree 2 files changed +22
-7
lines changed
Expand file tree Collapse file tree 2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ changes.
1616
1717### Fixed
1818
19- -
19+ - Fix calculating DRep live voting power [ Issue 2460 ] ( https://github.com/IntersectMBO/govtool/issues/2460 )
2020
2121### Changed
2222
Original file line number Diff line number Diff line change 1- select coalesce(sum (uv .value ), 0 ) as amount
2- from utxo_view uv
3- join delegation_vote dv on uv .stake_address_id = dv .addr_id
4- join drep_hash dh on dv .drep_hash_id = dh .id
5- where dh .raw = decode(?,' hex' )
6- and dv .cert_index != 0
1+ WITH LatestDelegationVote AS (
2+ SELECT
3+ addr_id,
4+ MAX (id) AS latest_vote_id
5+ FROM
6+ delegation_vote
7+ GROUP BY
8+ addr_id
9+ )
10+ SELECT
11+ SUM (uv .value ) AS total_value
12+ FROM
13+ utxo_view uv
14+ JOIN
15+ stake_address sa ON sa .id = uv .stake_address_id
16+ JOIN
17+ LatestDelegationVote ldv ON uv .stake_address_id = ldv .addr_id
18+ JOIN
19+ delegation_vote dv ON dv .id = ldv .latest_vote_id
20+ WHERE
21+ dv .drep_hash_id = (SELECT id FROM drep_hash WHERE raw = decode(?,' hex' ))
You can’t perform that action at this time.
0 commit comments