Skip to content

Commit

Permalink
Only count last vote by committee member for a given proposal
Browse files Browse the repository at this point in the history
  • Loading branch information
cardadad committed Aug 29, 2024
1 parent 28c3ff5 commit 1adc77b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion files/grest/rpc/governance/proposal_voting_summary.sql
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,10 @@ RETURN QUERY (
vote,
COUNT(*) AS committee_votes_cast
FROM proposal_epoch_data AS ped
INNER JOIN voting_procedure AS vp ON vp.voter_role = 'ConstitutionalCommittee' AND vp.gov_action_proposal_id = ped.gov_action_proposal_id
INNER JOIN voting_procedure AS vp ON vp.voter_role = 'ConstitutionalCommittee'
AND vp.gov_action_proposal_id = ped.gov_action_proposal_id
AND NOT EXISTS (select null from voting_procedure vp2 where vp2.gov_action_proposal_id = vp.gov_action_proposal_id
and vp2.committee_voter = vp.committee_voter and vp2.id > vp.id)
GROUP BY ped.gov_action_proposal_id, vote
),
tot_committee_size AS (
Expand Down

0 comments on commit 1adc77b

Please sign in to comment.