fn start_tally() {
		let active_council = Self::active_council();
		let desired_seats = Self::desired_seats() as usize;
		let number = <system::Module<T>>::block_number();
		let expiring = active_council.iter().take_while(|i| i.1 == number).map(|i| i.0.clone()).collect::<Vec<_>>();
		let retaining_seats = active_council.len() - expiring.len();
		if retaining_seats < desired_seats {
			let empty_seats = desired_seats - retaining_seats;
			<NextFinalize<T>>::put((number + Self::presentation_duration(), empty_seats as u32, expiring));

			let voters = Self::voters();
			let votes = voters.iter().map(T::Currency::total_balance).collect::<Vec<_>>();
			<SnapshotedStakes<T>>::put(votes);

			// initialize leaderboard.
			let leaderboard_size = empty_seats + Self::carry_count() as usize;
			<Leaderboard<T>>::put(vec![(BalanceOf::<T>::zero(), T::AccountId::default()); leaderboard_size]);

			Self::deposit_event(RawEvent::TallyStarted(empty_seats as u32));
		}
	}
/// Close the voting. Snapshot the staking and the number of seats that are actually up for grabs.
Close the voting. Snapshot the staking and the number of seats that are actually up for grabs.
Close the voting . Snapshot the staking and the number of seats that are actually up for grabs .
fn start_tally() {
		let active_council = Self::active_council();
		let desired_seats = Self::desired_seats() as usize;
		let number = <system::Module<T>>::block_number();
		let expiring = active_council.iter().take_while(|i| i.1 == number).map(|i| i.0.clone()).collect::<Vec<_>>();
		let retaining_seats = active_council.len() - expiring.len();
		if retaining_seats < desired_seats {
			let empty_seats = desired_seats - retaining_seats;
			<NextFinalize<T>>::put((number + Self::presentation_duration(), empty_seats as u32, expiring));
			let voters = Self::voters();
			let votes = voters.iter().map(T::Currency::total_balance).collect::<Vec<_>>();
			<SnapshotedStakes<T>>::put(votes);
			// initialize leaderboard.
			let leaderboard_size = empty_seats + Self::carry_count() as usize;
			<Leaderboard<T>>::put(vec![(BalanceOf::<T>::zero(), T::AccountId::default()); leaderboard_size]);
			Self::deposit_event(RawEvent::TallyStarted(empty_seats as u32));
		}
	}
fn start_tally ( ) { let active_council = Self :: active_council ( ) ; let desired_seats = Self :: desired_seats ( ) as usize ; let number = < system :: Module < T > > :: block_number ( ) ; let expiring = active_council . iter ( ) . take_while ( | i | i . 1 == number ) . map ( | i | i . 0 . clone ( ) ) . collect :: < Vec < _ > > ( ) ; let retaining_seats = active_council . len ( ) - expiring . len ( ) ; if retaining_seats < desired_seats { let empty_seats = desired_seats - retaining_seats ; < NextFinalize < T > > :: put ( ( number + Self :: presentation_duration ( ) , empty_seats as u32 , expiring ) ) ; let voters = Self :: voters ( ) ; let votes = voters . iter ( ) . map ( T :: Currency :: total_balance ) . collect :: < Vec < _ > > ( ) ; < SnapshotedStakes < T > > :: put ( votes ) ; // initialize leaderboard. let leaderboard_size = empty_seats + Self :: carry_count ( ) as usize ; < Leaderboard < T > > :: put ( vec ! [ ( BalanceOf T zero ( ) T AccountId default ( ) ) leaderboard_size ] ) ; Self :: deposit_event ( RawEvent :: TallyStarted ( empty_seats as u32 ) ) ; } }
Close the voting.
Close the voting .