@@ -84,6 +84,8 @@ export const VotesSubmitted = ({
8484 dRepAbstainVotes + ( networkTotalStake ?. alwaysAbstainVotingPower ?? 0 ) ;
8585
8686 // TODO: Move this logic to backend
87+
88+ // DRep votes
8789 const dRepYesVotesPercentage = totalStakeControlledByDReps
8890 ? ( dRepYesVotes / totalStakeControlledByDReps ) * 100
8991 : undefined ;
@@ -108,25 +110,45 @@ export const VotesSubmitted = ({
108110 const dRepNotVotedVotesPercentage =
109111 100 - ( dRepYesVotesPercentage ?? 0 ) - ( dRepNoVotesPercentage ?? 0 ) ;
110112
113+ // SPO/Pool votes
111114 const poolYesVotesPercentage =
112- poolYesVotes + poolNoVotes
113- ? ( poolYesVotes / ( poolYesVotes + poolNoVotes ) ) * 100
115+ typeof poolYesVotes === "number" &&
116+ typeof networkTotalStake ?. totalStakeControlledBySPOs === "number" &&
117+ networkTotalStake . totalStakeControlledBySPOs > 0
118+ ? ( poolYesVotes / networkTotalStake . totalStakeControlledBySPOs ) * 100
114119 : undefined ;
115- const poolNoVotesPercentage = poolYesVotesPercentage
116- ? 100 - poolYesVotesPercentage
117- : poolNoVotes
118- ? 100
119- : undefined ;
120120
121+ const poolNoVotesPercentage =
122+ typeof poolNoVotes === "number" &&
123+ typeof networkTotalStake ?. totalStakeControlledBySPOs === "number" &&
124+ networkTotalStake . totalStakeControlledBySPOs > 0
125+ ? ( poolNoVotes / networkTotalStake . totalStakeControlledBySPOs ) * 100
126+ : undefined ;
127+
128+ const poolNotVotedVotes =
129+ typeof networkTotalStake ?. totalStakeControlledBySPOs === "number"
130+ ? networkTotalStake . totalStakeControlledBySPOs -
131+ ( poolYesVotes + poolNoVotes + poolAbstainVotes )
132+ : undefined ;
133+
134+ const poolNotVotedVotesPercentage =
135+ 100 -
136+ ( typeof poolYesVotesPercentage === "number" ? poolYesVotesPercentage : 0 ) -
137+ ( typeof poolNoVotesPercentage === "number" ? poolNoVotesPercentage : 0 ) ;
138+
139+ // Constitutional Commission votes
121140 const ccYesVotesPercentage = noOfCommitteeMembers
122141 ? ( ccYesVotes / noOfCommitteeMembers ) * 100
123142 : undefined ;
124- const ccNoVotesPercentage = noOfCommitteeMembers
143+
144+ const ccNoVotesPercentage = noOfCommitteeMembers
125145 ? ( ccNoVotes / noOfCommitteeMembers ) * 100
126146 : undefined ;
127- const ccNotVotedVotes =
147+
148+ const ccNotVotedVotes =
128149 noOfCommitteeMembers - ccYesVotes - ccNoVotes - ccAbstainVotes ;
129- const ccNotVotedVotesPercentage =
150+
151+ const ccNotVotedVotesPercentage =
130152 100 - ( ccYesVotesPercentage ?? 0 ) - ( ccNoVotesPercentage ?? 0 ) ;
131153
132154 return (
@@ -200,6 +222,8 @@ export const VotesSubmitted = ({
200222 noVotes = { poolNoVotes }
201223 noVotesPercentage = { poolNoVotesPercentage }
202224 abstainVotes = { poolAbstainVotes }
225+ notVotedVotes = { poolNotVotedVotes }
226+ notVotedPercentage = { poolNotVotedVotesPercentage }
203227 threshold = {
204228 ( ( ) => {
205229 const votingThresholdKey = getGovActionVotingThresholdKey ( {
0 commit comments