@@ -50,27 +50,38 @@ export const VotesSubmitted = ({
5050 const { t } = useTranslation ( ) ;
5151 const { epochParams, networkMetrics } = useAppContext ( ) ;
5252
53+ // Coming from be
54+ // Equal to: total active drep stake + auto no-confidence stake
5355 const totalStakeControlledByDReps =
5456 networkMetrics ?. totalStakeControlledByDReps ?? 0 ;
5557
58+ // Governance action abstain votesa + auto abstain votes
59+ const totalAbstainVotes =
60+ dRepAbstainVotes + ( networkMetrics ?. alwaysAbstainVotingPower ?? 0 ) ;
61+
5662 // TODO: Move this logic to backend
5763 const dRepYesVotesPercentage = totalStakeControlledByDReps
5864 ? ( dRepYesVotes / totalStakeControlledByDReps ) * 100
5965 : undefined ;
66+
6067 const dRepNoVotesPercentage = totalStakeControlledByDReps
6168 ? ( dRepNoVotes / totalStakeControlledByDReps ) * 100
6269 : undefined ;
70+
6371 const dRepNotVotedVotes = totalStakeControlledByDReps
6472 ? totalStakeControlledByDReps -
6573 ( dRepYesVotes -
74+ // As this is already added on backend
6675 ( govActionType === GovernanceActionType . NoConfidence
6776 ? networkMetrics ?. alwaysNoConfidenceVotingPower ?? 0
6877 : 0 ) ) -
6978 ( dRepNoVotes -
79+ // As this is already added on backend
7080 ( govActionType === GovernanceActionType . NoConfidence
7181 ? 0
7282 : networkMetrics ?. alwaysNoConfidenceVotingPower ?? 0 ) ) -
73- ( dRepAbstainVotes - ( networkMetrics ?. alwaysAbstainVotingPower ?? 0 ) )
83+ // As this being voted for the action becomes part of the total active stake
84+ dRepAbstainVotes
7485 : undefined ;
7586 const dRepNotVotedVotesPercentage =
7687 100 - ( dRepYesVotesPercentage ?? 0 ) - ( dRepNoVotesPercentage ?? 0 ) ;
@@ -143,7 +154,7 @@ export const VotesSubmitted = ({
143154 yesVotesPercentage = { dRepYesVotesPercentage }
144155 noVotes = { dRepNoVotes }
145156 noVotesPercentage = { dRepNoVotesPercentage }
146- abstainVotes = { dRepAbstainVotes }
157+ abstainVotes = { totalAbstainVotes }
147158 notVotedVotes = { dRepNotVotedVotes }
148159 notVotedPercentage = { dRepNotVotedVotesPercentage }
149160 threshold = { ( ( ) => {
0 commit comments