INNER CODE UNIT · Rust
register_as_candidate
AstarNetwork/Astar · pallets/collator-selection/src/lib.rs:426
pub fn register_as_candidate(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let _who = ensure_signed(origin)?;
// Always fail with permission error to enforce new workflow
Err(Error::<T>::Permission.into())
}
/// Deregister `origin` as a collator candidate. Note that the collator can only leave on
/// session change. The `CandidacyBond` will start un-bonding process.
///
/// This call will fail if the total number of candidates would drop below `MinCandidates`.
///
/// This call is not available to `Invulnerable` collators.
#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::leave_intent(T::MaxCandidates::get()))]
pub fn leave_intent(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
let who = ensure_signed(origin)?;
ensure!(
Candidates::<T>::get().len() as u32 > T::MinCandidates::get(),