Skip to content

Commit

Permalink
Merge pull request #2406 from IntersectMBO/fix/fix-ada-holder-voting-…
Browse files Browse the repository at this point in the history
…power

fix: fix ada holder voting power calculation
  • Loading branch information
MSzalowski authored Nov 26, 2024
2 parents 789f586 + 36fd9bb commit d5b0733
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 d5b0733

Please sign in to comment.