fn launch_next(now: T::BlockNumber) -> Result {
		let mut public_props = Self::public_props();
		if let Some((winner_index, _)) = public_props.iter()
			.enumerate()
			.max_by_key(|x| Self::locked_for((x.1).0).unwrap_or_else(Zero::zero))
			//										  ^^^^^^^^^^^^^^
			// defensive only: All current public proposals have an amount locked
		{
			let (prop_index, proposal, _) = public_props.swap_remove(winner_index);
			<PublicProps<T>>::put(public_props);

			if let Some((deposit, depositors)) = <DepositOf<T>>::take(prop_index) {
				// refund depositors
				for d in &depositors {
					T::Currency::unreserve(d, deposit);
				}
				Self::deposit_event(RawEvent::Tabled(prop_index, deposit, depositors));
				Self::inject_referendum(
					now + Self::voting_period(),
					proposal,
					VoteThreshold::SuperMajorityApprove,
					Self::public_delay()
				)?;
			}
		}

		Ok(())
	}
/// Find the proposal that will be the next referendum, unreserves the currency of
/// the depositors, and opens the voting period.
Find the proposal that will be the next referendum, unreserves the currency of
the depositors, and opens the voting period.
Find the proposal that will be the next referendum unreserves the currency of the depositors and opens the voting period .
fn launch_next(now: T::BlockNumber) -> Result {
		let mut public_props = Self::public_props();
		if let Some((winner_index, _)) = public_props.iter()
			.enumerate()
			.max_by_key(|x| Self::locked_for((x.1).0).unwrap_or_else(Zero::zero))
			//										  ^^^^^^^^^^^^^^
			// defensive only: All current public proposals have an amount locked
		{
			let (prop_index, proposal, _) = public_props.swap_remove(winner_index);
			<PublicProps<T>>::put(public_props);
			if let Some((deposit, depositors)) = <DepositOf<T>>::take(prop_index) {
				// refund depositors
				for d in &depositors {
					T::Currency::unreserve(d, deposit);
				}
				Self::deposit_event(RawEvent::Tabled(prop_index, deposit, depositors));
				Self::inject_referendum(
					now + Self::voting_period(),
					proposal,
					VoteThreshold::SuperMajorityApprove,
					Self::public_delay()
				)?;
			}
		}
		Ok(())
	}
fn launch_next ( now : T :: BlockNumber ) -> Result { let mut public_props = Self :: public_props ( ) ; if let Some ( ( winner_index , _ ) ) = public_props . iter ( ) . enumerate ( ) . max_by_key ( | x | Self :: locked_for ( ( x . 1 ) . 0 ) . unwrap_or_else ( Zero :: zero ) ) //										  ^^^^^^^^^^^^^^ // defensive only: All current public proposals have an amount locked { let ( prop_index , proposal , _ ) = public_props . swap_remove ( winner_index ) ; < PublicProps < T > > :: put ( public_props ) ; if let Some ( ( deposit , depositors ) ) = < DepositOf < T > > :: take ( prop_index ) { // refund depositors for d in & depositors { T :: Currency :: unreserve ( d , deposit ) ; } Self :: deposit_event ( RawEvent :: Tabled ( prop_index , deposit , depositors ) ) ; Self :: inject_referendum ( now + Self :: voting_period ( ) , proposal , VoteThreshold :: SuperMajorityApprove , Self :: public_delay ( ) ) ? ; } } Ok ( ( ) ) }
Find the proposal that will be the next referendum, unreserves the currency of
the depositors, and opens the voting period.
Find the proposal that will be the next referendum unreserves the currency of the depositors and opens the voting period .
now
T::BlockNumber
now
T::BlockNumber