fn try_remove_candidate(who: &T::AccountId) -> Result<usize, DispatchError> {
			let current_count =
				<Candidates<T>>::try_mutate(|candidates| -> Result<usize, DispatchError> {
					let index = candidates
						.iter()
						.position(|candidate| candidate.who == *who)
						.ok_or(Error::<T>::NotCandidate)?;
					T::Currency::remove_lock(VALIDATOR_STAKING_ID, &who);
					candidates.remove(index);
					<LastAuthoredBlock<T>>::remove(who.clone());
					Ok(candidates.len())
				})?;
			Self::deposit_event(Event::CandidateRemoved(who.clone()));
			Ok(current_count)
		}
/// Removes a candidate if they exist and sends them back their deposit
Removes a candidate if they exist and sends them back their deposit
Removes a candidate if they exist and sends them back their deposit
fn try_remove_candidate(who: &T::AccountId) -> Result<usize, DispatchError> {
			let current_count =
				<Candidates<T>>::try_mutate(|candidates| -> Result<usize, DispatchError> {
					let index = candidates
						.iter()
						.position(|candidate| candidate.who == *who)
						.ok_or(Error::<T>::NotCandidate)?;
					T::Currency::remove_lock(VALIDATOR_STAKING_ID, &who);
					candidates.remove(index);
					<LastAuthoredBlock<T>>::remove(who.clone());
					Ok(candidates.len())
				})?;
			Self::deposit_event(Event::CandidateRemoved(who.clone()));
			Ok(current_count)
		}
fn try_remove_candidate ( who : & T :: AccountId ) -> Result < usize , DispatchError > { let current_count = < Candidates < T > > :: try_mutate ( | candidates | -> Result < usize , DispatchError > { let index = candidates . iter ( ) . position ( | candidate | candidate . who == * who ) . ok_or ( Error :: < T > :: NotCandidate ) ? ; T :: Currency :: remove_lock ( VALIDATOR_STAKING_ID , & who ) ; candidates . remove ( index ) ; < LastAuthoredBlock < T > > :: remove ( who . clone ( ) ) ; Ok ( candidates . len ( ) ) } ) ? ; Self :: deposit_event ( Event :: CandidateRemoved ( who . clone ( ) ) ) ; Ok ( current_count ) }
Removes a candidate if they exist and sends them back their deposit
Removes a candidate if they exist and sends them back their deposit
who
&T::AccountId