pub fn tally(ref_index: ReferendumIndex) -> (BalanceOf<T>, BalanceOf<T>, BalanceOf<T>) {
		let (approve, against, capital): (BalanceOf<T>, BalanceOf<T>, BalanceOf<T>) = Self::voters_for(ref_index)
			.iter()
			.map(|voter| (
				T::Currency::total_balance(voter), Self::vote_of((ref_index, voter.clone()))
			))
			.map(|(bal, vote)|
				if vote.is_aye() {
					(bal * BalanceOf::<T>::sa(vote.multiplier() as u64), Zero::zero(), bal)
				} else {
					(Zero::zero(), bal * BalanceOf::<T>::sa(vote.multiplier() as u64), bal)
				}
			).fold((Zero::zero(), Zero::zero(), Zero::zero()), |(a, b, c), (d, e, f)| (a + d, b + e, c + f));
		let (del_approve, del_against, del_capital) = Self::tally_delegation(ref_index);
		(approve + del_approve, against + del_against, capital + del_capital)
	}
/// Tally the votes for the current proposal. Returns a tuple with weighted votes for,
/// weighted votes against, and total capital represented in the vote.
Tally the votes for the current proposal. Returns a tuple with weighted votes for,
weighted votes against, and total capital represented in the vote.
Tally the votes for the current proposal . Returns a tuple with weighted votes for weighted votes against and total capital represented in the vote .
pub fn tally(ref_index: ReferendumIndex) -> (BalanceOf<T>, BalanceOf<T>, BalanceOf<T>) {
		let (approve, against, capital): (BalanceOf<T>, BalanceOf<T>, BalanceOf<T>) = Self::voters_for(ref_index)
			.iter()
			.map(|voter| (
				T::Currency::total_balance(voter), Self::vote_of((ref_index, voter.clone()))
			))
			.map(|(bal, vote)|
				if vote.is_aye() {
					(bal * BalanceOf::<T>::sa(vote.multiplier() as u64), Zero::zero(), bal)
				} else {
					(Zero::zero(), bal * BalanceOf::<T>::sa(vote.multiplier() as u64), bal)
				}
			).fold((Zero::zero(), Zero::zero(), Zero::zero()), |(a, b, c), (d, e, f)| (a + d, b + e, c + f));
		let (del_approve, del_against, del_capital) = Self::tally_delegation(ref_index);
		(approve + del_approve, against + del_against, capital + del_capital)
	}
pub fn tally ( ref_index : ReferendumIndex ) -> ( BalanceOf < T > , BalanceOf < T > , BalanceOf < T > ) { let ( approve , against , capital ) : ( BalanceOf < T > , BalanceOf < T > , BalanceOf < T > ) = Self :: voters_for ( ref_index ) . iter ( ) . map ( | voter | ( T :: Currency :: total_balance ( voter ) , Self :: vote_of ( ( ref_index , voter . clone ( ) ) ) ) ) . map ( | ( bal , vote ) | if vote . is_aye ( ) { ( bal * BalanceOf :: < T > :: sa ( vote . multiplier ( ) as u64 ) , Zero :: zero ( ) , bal ) } else { ( Zero :: zero ( ) , bal * BalanceOf :: < T > :: sa ( vote . multiplier ( ) as u64 ) , bal ) } ) . fold ( ( Zero :: zero ( ) , Zero :: zero ( ) , Zero :: zero ( ) ) , | ( a , b , c ) , ( d , e , f ) | ( a + d , b + e , c + f ) ) ; let ( del_approve , del_against , del_capital ) = Self :: tally_delegation ( ref_index ) ; ( approve + del_approve , against + del_against , capital + del_capital ) }
Tally the votes for the current proposal.
Tally the votes for the current proposal .
ref_index
ReferendumIndex
ref_index
ReferendumIndex