File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -22,13 +22,18 @@ CurrentEpoch AS (
2222 SELECT MAX (no) AS no FROM epoch
2323),
2424CommitteeMembers AS (
25- SELECT DISTINCT ON (cm .committee_hash_id )
26- cm .id ,
27- cm .expiration_epoch
25+ SELECT
26+ DISTINCT cm .committee_hash_id AS committee_members
2827 FROM committee_member cm
29- CROSS JOIN CurrentEpoch
30- WHERE
31- cm .expiration_epoch >= CurrentEpoch .no
28+ JOIN committee c ON c .id = cm .committee_id
29+ LEFT JOIN gov_action_proposal gap ON gap .id = c .gov_action_proposal_id
30+ CROSS JOIN CurrentEpoch ce
31+ WHERE (
32+ (c .gov_action_proposal_id IS NULL )
33+ OR
34+ (gap .enacted_epoch IS NOT NULL AND gap .enacted_epoch <= ce .no )
35+ )
36+ AND cm .expiration_epoch >= ce .no
3237),
3338NoOfCommitteeMembers AS (
3439 SELECT COUNT (* ) total FROM CommitteeMembers
You can’t perform that action at this time.
0 commit comments