@@ -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 =
54- networkMetrics ?. totalStakeControlledByDReps ?? 0 ;
56+ ( networkMetrics ?. totalStakeControlledByDReps ?? 0 ) -
57+ // As this being voted for the action becomes part of the total active stake
58+ dRepAbstainVotes ;
59+
60+ // Governance action abstain votesa + auto abstain votes
61+ const totalAbstainVotes =
62+ dRepAbstainVotes + ( networkMetrics ?. alwaysAbstainVotingPower ?? 0 ) ;
5563
5664 // TODO: Move this logic to backend
5765 const dRepYesVotesPercentage = totalStakeControlledByDReps
5866 ? ( dRepYesVotes / totalStakeControlledByDReps ) * 100
5967 : undefined ;
68+
6069 const dRepNoVotesPercentage = totalStakeControlledByDReps
6170 ? ( dRepNoVotes / totalStakeControlledByDReps ) * 100
6271 : undefined ;
72+
6373 const dRepNotVotedVotes = totalStakeControlledByDReps
6474 ? totalStakeControlledByDReps -
6575 ( dRepYesVotes -
76+ // As this is already added on backend
6677 ( govActionType === GovernanceActionType . NoConfidence
6778 ? networkMetrics ?. alwaysNoConfidenceVotingPower ?? 0
6879 : 0 ) ) -
6980 ( dRepNoVotes -
81+ // As this is already added on backend
7082 ( govActionType === GovernanceActionType . NoConfidence
7183 ? 0
72- : networkMetrics ?. alwaysNoConfidenceVotingPower ?? 0 ) ) -
73- ( dRepAbstainVotes - ( networkMetrics ?. alwaysAbstainVotingPower ?? 0 ) )
84+ : networkMetrics ?. alwaysNoConfidenceVotingPower ?? 0 ) )
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