Skip to content

Commit

Permalink
fix: fix ada holder voting power calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
MSzalowski committed Nov 22, 2024
1 parent af1ca81 commit 36fd9bb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ changes.

### Fixed

- Fix ada holder voting power calculation
- Fix listing voted-on governance actions [Issue 2379](https://github.com/IntersectMBO/govtool/issues/2379)
- Fix wronly displayed markdown on slider card [Issue 2263](https://github.com/IntersectMBO/govtool/issues/2316)
- fix ada quantities format to avoid thousands when the total is 0 [Issue 2372](https://github.com/IntersectMBO/govtool/issues/2382)
Expand Down
9 changes: 2 additions & 7 deletions govtool/backend/sql/get-stake-key-voting-power.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
SELECT COALESCE(SUM(utxo_view.value::numeric), 0) + COALESCE(reward_sum.total_reward, 0) AS total_value,
SELECT COALESCE(SUM(utxo_view.value::numeric), 0),
encode(stake_address.hash_raw, 'hex')
FROM stake_address
JOIN utxo_view ON utxo_view.stake_address_id = stake_address.id
LEFT JOIN (
SELECT addr_id, SUM(reward_rest.amount) AS total_reward
FROM reward_rest
GROUP BY addr_id
) AS reward_sum ON reward_sum.addr_id = stake_address.id
WHERE stake_address.hash_raw = decode(?, 'hex')
GROUP BY stake_address.hash_raw, reward_sum.total_reward;
GROUP BY stake_address.hash_raw;

0 comments on commit 36fd9bb

Please sign in to comment.