Skip to content

Commit 8fb4e5e

Browse files
committed
fix(#1960): make calculation of the DRep voting power on the backend
1 parent d113332 commit 8fb4e5e

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ changes.
2626

2727
- Bumped Cardano node version to `10.1.0-pre`.
2828
- Bumped Cardano DB Sync version to `13.6.0.0-pre`.
29+
- Make calculation of a DRep voting power on the backend [Issue 1960](https://github.com/IntersectMBO/govtool/issues/1960)
2930

3031
### Removed
3132

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
select coalesce(drep_distr.amount, 0) as amount
2-
from drep_hash
3-
left join drep_distr
4-
on drep_hash.id = drep_distr.hash_id
5-
where drep_hash.raw = decode(?,'hex')
6-
order by epoch_no desc
7-
limit 1
1+
select sum(uv.value) 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

0 commit comments

Comments
 (0)