Skip to content

Commit

Permalink
fix(#1960): make calculation of the DRep voting power on the backend
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Nov 15, 2024
1 parent d113332 commit 8fb4e5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ changes.

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

### Removed

Expand Down
13 changes: 6 additions & 7 deletions govtool/backend/sql/get-voting-power.sql
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
select coalesce(drep_distr.amount, 0) as amount
from drep_hash
left join drep_distr
on drep_hash.id = drep_distr.hash_id
where drep_hash.raw = decode(?,'hex')
order by epoch_no desc
limit 1
select sum(uv.value) as amount
from utxo_view uv
join delegation_vote dv on uv.stake_address_id = dv.addr_id
join drep_hash dh on dv.drep_hash_id = dh.id
where dh.raw = decode(?,'hex')
and dv.cert_index != 0

0 comments on commit 8fb4e5e

Please sign in to comment.