fn new_era() {
		// Payout
		let reward = <CurrentEraReward<T>>::take();
		if !reward.is_zero() {
			let validators = Self::current_elected();
			for v in validators.iter() {
				Self::reward_validator(v, reward);
			}
			Self::deposit_event(RawEvent::Reward(reward));
			let total_minted = reward * <BalanceOf<T> as As<usize>>::sa(validators.len());
			let total_rewarded_stake = Self::slot_stake() * <BalanceOf<T> as As<usize>>::sa(validators.len());
			T::OnRewardMinted::on_dilution(total_minted, total_rewarded_stake);
		}

		// Increment current era.
		<CurrentEra<T>>::put(&(<CurrentEra<T>>::get() + One::one()));

		// Enact era length change.
		if let Some(next_spe) = Self::next_sessions_per_era() {
			if next_spe != Self::sessions_per_era() {
				<SessionsPerEra<T>>::put(&next_spe);
				<LastEraLengthChange<T>>::put(&<session::Module<T>>::current_index());
			}
		}

		// Reassign all Stakers.
		let slot_stake = Self::select_validators();

		// Update the balances for rewarding according to the stakes.
		<CurrentSessionReward<T>>::put(Self::session_reward() * slot_stake);
	}
/// The era has changed - enact new staking set.
///
/// NOTE: This always happens immediately before a session change to ensure that new validators
/// get a chance to set their session keys.
The era has changed - enact new staking set.
NOTE: This always happens immediately before a session change to ensure that new validators
get a chance to set their session keys.
The era has changed - enact new staking set . NOTE : This always happens immediately before a session change to ensure that new validators get a chance to set their session keys .
fn new_era() {
		// Payout
		let reward = <CurrentEraReward<T>>::take();
		if !reward.is_zero() {
			let validators = Self::current_elected();
			for v in validators.iter() {
				Self::reward_validator(v, reward);
			}
			Self::deposit_event(RawEvent::Reward(reward));
			let total_minted = reward * <BalanceOf<T> as As<usize>>::sa(validators.len());
			let total_rewarded_stake = Self::slot_stake() * <BalanceOf<T> as As<usize>>::sa(validators.len());
			T::OnRewardMinted::on_dilution(total_minted, total_rewarded_stake);
		}
		// Increment current era.
		<CurrentEra<T>>::put(&(<CurrentEra<T>>::get() + One::one()));
		// Enact era length change.
		if let Some(next_spe) = Self::next_sessions_per_era() {
			if next_spe != Self::sessions_per_era() {
				<SessionsPerEra<T>>::put(&next_spe);
				<LastEraLengthChange<T>>::put(&<session::Module<T>>::current_index());
			}
		}
		// Reassign all Stakers.
		let slot_stake = Self::select_validators();
		// Update the balances for rewarding according to the stakes.
		<CurrentSessionReward<T>>::put(Self::session_reward() * slot_stake);
	}
fn new_era ( ) { // Payout let reward = < CurrentEraReward < T > > :: take ( ) ; if ! reward . is_zero ( ) { let validators = Self :: current_elected ( ) ; for v in validators . iter ( ) { Self :: reward_validator ( v , reward ) ; } Self :: deposit_event ( RawEvent :: Reward ( reward ) ) ; let total_minted = reward * < BalanceOf < T > as As < usize > > :: sa ( validators . len ( ) ) ; let total_rewarded_stake = Self :: slot_stake ( ) * < BalanceOf < T > as As < usize > > :: sa ( validators . len ( ) ) ; T :: OnRewardMinted :: on_dilution ( total_minted , total_rewarded_stake ) ; } // Increment current era. < CurrentEra < T > > :: put ( & ( < CurrentEra < T > > :: get ( ) + One :: one ( ) ) ) ; // Enact era length change. if let Some ( next_spe ) = Self :: next_sessions_per_era ( ) { if next_spe != Self :: sessions_per_era ( ) { < SessionsPerEra < T > > :: put ( & next_spe ) ; < LastEraLengthChange < T > > :: put ( & < session :: Module < T > > :: current_index ( ) ) ; } } // Reassign all Stakers. let slot_stake = Self :: select_validators ( ) ; // Update the balances for rewarding according to the stakes. < CurrentSessionReward < T > > :: put ( Self :: session_reward ( ) * slot_stake ) ; }
The era has changed - enact new staking set.
The era has changed - enact new staking set .