Enum pallet_collator_selection::pallet::Call
source · pub enum Call<T: Config> {
set_invulnerables {
new: Vec<T::AccountId>,
},
set_desired_candidates {
max: u32,
},
set_candidacy_bond {
bond: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance,
},
register_as_candidate {},
leave_intent {},
add_invulnerable {
who: T::AccountId,
},
remove_invulnerable {
who: T::AccountId,
},
update_bond {
new_deposit: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance,
},
take_candidate_slot {
deposit: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance,
target: T::AccountId,
},
// some variants omitted
}Expand description
Contains a variant per dispatchable extrinsic that this pallet has.
Variants§
set_invulnerables
Set the list of invulnerable (fixed) collators. These collators must do some preparation, namely to have registered session keys.
The call will remove any accounts that have not registered keys from the set. That is,
it is non-atomic; the caller accepts all AccountIds passed in new individually as
acceptable Invulnerables, and is not proposing a set of new Invulnerables.
This call does not maintain mutual exclusivity of Invulnerables and Candidates. It
is recommended to use a batch of add_invulnerable and remove_invulnerable instead. A
batch_all can also be used to enforce atomicity. If any candidates are included in
new, they should be removed with remove_invulnerable_candidate after execution.
Must be called by the UpdateOrigin.
set_desired_candidates
Set the ideal number of non-invulnerable collators. If lowering this number, then the number of running collators could be higher than this figure. Aside from that edge case, there should be no other way to have more candidates than the desired number.
The origin for this call must be the UpdateOrigin.
set_candidacy_bond
Set the candidacy bond amount.
If the candidacy bond is increased by this call, all current candidates which have a deposit lower than the new bond will be kicked from the list and get their deposits back.
The origin for this call must be the UpdateOrigin.
register_as_candidate
Register this account as a collator candidate. The account must (a) already have
registered session keys and (b) be able to reserve the CandidacyBond.
This call is not available to Invulnerable collators.
leave_intent
Deregister origin as a collator candidate. Note that the collator can only leave on
session change. The CandidacyBond will be unreserved immediately.
This call will fail if the total number of candidates would drop below
MinEligibleCollators.
add_invulnerable
Add a new account who to the list of Invulnerables collators. who must have
registered session keys. If who is a candidate, they will be removed.
The origin for this call must be the UpdateOrigin.
remove_invulnerable
Remove an account who from the list of Invulnerables collators. Invulnerables must
be sorted.
The origin for this call must be the UpdateOrigin.
update_bond
Update the candidacy bond of collator candidate origin to a new amount new_deposit.
Setting a new_deposit that is lower than the current deposit while origin is
occupying a top-DesiredCandidates slot is not allowed.
This call will fail if origin is not a collator candidate, the updated bond is lower
than the minimum candidacy bond, and/or the amount cannot be reserved.
take_candidate_slot
Fields
The caller origin replaces a candidate target in the collator candidate list by
reserving deposit. The amount deposit reserved by the caller must be greater than
the existing bond of the target it is trying to replace.
This call will fail if the caller is already a collator candidate or invulnerable, the
caller does not have registered session keys, the target is not a collator candidate,
and/or the deposit amount cannot be reserved.
Implementations§
source§impl<T: Config> Call<T>
impl<T: Config> Call<T>
sourcepub fn new_call_variant_set_invulnerables(new: Vec<T::AccountId>) -> Self
pub fn new_call_variant_set_invulnerables(new: Vec<T::AccountId>) -> Self
Create a call with the variant set_invulnerables.
sourcepub fn new_call_variant_set_desired_candidates(max: u32) -> Self
pub fn new_call_variant_set_desired_candidates(max: u32) -> Self
Create a call with the variant set_desired_candidates.
sourcepub fn new_call_variant_set_candidacy_bond(
bond: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance
) -> Self
pub fn new_call_variant_set_candidacy_bond( bond: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance ) -> Self
Create a call with the variant set_candidacy_bond.
sourcepub fn new_call_variant_register_as_candidate() -> Self
pub fn new_call_variant_register_as_candidate() -> Self
Create a call with the variant register_as_candidate.
sourcepub fn new_call_variant_leave_intent() -> Self
pub fn new_call_variant_leave_intent() -> Self
Create a call with the variant leave_intent.
sourcepub fn new_call_variant_add_invulnerable(who: T::AccountId) -> Self
pub fn new_call_variant_add_invulnerable(who: T::AccountId) -> Self
Create a call with the variant add_invulnerable.
sourcepub fn new_call_variant_remove_invulnerable(who: T::AccountId) -> Self
pub fn new_call_variant_remove_invulnerable(who: T::AccountId) -> Self
Create a call with the variant remove_invulnerable.
sourcepub fn new_call_variant_update_bond(
new_deposit: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance
) -> Self
pub fn new_call_variant_update_bond( new_deposit: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance ) -> Self
Create a call with the variant update_bond.
sourcepub fn new_call_variant_take_candidate_slot(
deposit: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance,
target: T::AccountId
) -> Self
pub fn new_call_variant_take_candidate_slot( deposit: <<T as Config>::Currency as Currency<<T as SystemConfig>::AccountId>>::Balance, target: T::AccountId ) -> Self
Create a call with the variant take_candidate_slot.
Trait Implementations§
source§impl<T: Config> CheckIfFeeless for Call<T>
impl<T: Config> CheckIfFeeless for Call<T>
§type Origin = <T as Config>::RuntimeOrigin
type Origin = <T as Config>::RuntimeOrigin
source§fn is_feeless(&self, origin: &Self::Origin) -> bool
fn is_feeless(&self, origin: &Self::Origin) -> bool
#[pallet::feeless_if]source§impl<T: Config> Decode for Call<T>
impl<T: Config> Decode for Call<T>
source§fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl<T: Config> Encode for Call<T>
impl<T: Config> Encode for Call<T>
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl<T: Config> GetCallIndex for Call<T>
impl<T: Config> GetCallIndex for Call<T>
source§fn get_call_index(&self) -> u8
fn get_call_index(&self) -> u8
source§fn get_call_indices() -> &'static [u8] ⓘ
fn get_call_indices() -> &'static [u8] ⓘ
GetCallName.source§impl<T: Config> GetCallName for Call<T>
impl<T: Config> GetCallName for Call<T>
source§fn get_call_name(&self) -> &'static str
fn get_call_name(&self) -> &'static str
source§fn get_call_names() -> &'static [&'static str]
fn get_call_names() -> &'static [&'static str]
GetCallIndex.source§impl<T: Config> GetDispatchInfo for Call<T>
impl<T: Config> GetDispatchInfo for Call<T>
source§fn get_dispatch_info(&self) -> DispatchInfo
fn get_dispatch_info(&self) -> DispatchInfo
DispatchInfo, containing relevant information of this dispatch. Read moresource§impl<T: Config> PartialEq for Call<T>
impl<T: Config> PartialEq for Call<T>
source§impl<T: Config> UnfilteredDispatchable for Call<T>
impl<T: Config> UnfilteredDispatchable for Call<T>
§type RuntimeOrigin = <T as Config>::RuntimeOrigin
type RuntimeOrigin = <T as Config>::RuntimeOrigin
frame_system::Config::RuntimeOrigin).source§fn dispatch_bypass_filter(
self,
origin: Self::RuntimeOrigin
) -> DispatchResultWithPostInfo
fn dispatch_bypass_filter( self, origin: Self::RuntimeOrigin ) -> DispatchResultWithPostInfo
impl<T: Config> EncodeLike for Call<T>
impl<T: Config> Eq for Call<T>
Auto Trait Implementations§
impl<T> Freeze for Call<T>
impl<T> RefUnwindSafe for Call<T>where
T: RefUnwindSafe,
<T as Config>::AccountId: RefUnwindSafe,
<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance: RefUnwindSafe,
impl<T> Send for Call<T>where
T: Send,
impl<T> Sync for Call<T>where
T: Sync,
impl<T> Unpin for Call<T>
impl<T> UnwindSafe for Call<T>where
T: UnwindSafe,
<T as Config>::AccountId: UnwindSafe,
<<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T. Read moresource§impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
source§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T.