referrerpolicy=no-referrer-when-downgrade
westend_runtime

Type Alias Staking

Source
pub type Staking = Pallet<Runtime>;

Aliased Type§

struct Staking(/* private fields */);

Implementations

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn api_nominations_quota(balance: <T as Config>::CurrencyBalance) -> u32

Returns the current nominations quota for nominators.

Used by the runtime API.

Source

pub fn api_eras_stakers( era: u32, account: <T as Config>::AccountId, ) -> Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>

Source

pub fn api_eras_stakers_page_count( era: u32, account: <T as Config>::AccountId, ) -> u32

Source

pub fn api_pending_rewards(era: u32, account: <T as Config>::AccountId) -> bool

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn on_offence( offenders: impl Iterator<Item = OffenceDetails<<T as Config>::AccountId, <T as Config>::AccountId>>, slash_fractions: &[Perbill], slash_session: u32, ) -> Weight

When an offence is reported, it is split into pages and put in the offence queue. As offence queue is processed, computed slashes are queued to be applied after the SlashDeferDuration.

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn ensure_snapshot_metadata_state( now: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>

Test invariants of:

  • NextElectionPage: should only be set if pages > 1 and if we are within pages-election -> election
  • VoterSnapshotStatus: cannot be argued about as we don’t know when we get a call to data provider, but we know it should never be set if we have 1 page.

– SHOULD ONLY BE CALLED AT THE END OF A GIVEN BLOCK.

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn election_pages() -> u32

Fetches the number of pages configured by the election provider.

Source

pub fn ledger( account: StakingAccount<<T as Config>::AccountId>, ) -> Result<StakingLedger<T>, Error<T>>

Fetches the ledger associated with a controller or stash account, if any.

Source

pub fn payee( account: StakingAccount<<T as Config>::AccountId>, ) -> Option<RewardDestination<<T as Config>::AccountId>>

Source

pub fn bonded( stash: &<T as Config>::AccountId, ) -> Option<<T as Config>::AccountId>

Fetches the controller bonded to a stash account, if any.

Source

pub fn slashable_balance_of( stash: &<T as Config>::AccountId, ) -> <T as Config>::CurrencyBalance

The total balance that can be slashed from a stash account as of right now.

Source

pub fn slashable_balance_of_vote_weight( stash: &<T as Config>::AccountId, issuance: <T as Config>::CurrencyBalance, ) -> u64

Internal impl of Self::slashable_balance_of that returns VoteWeight.

Source

pub fn weight_of_fn() -> Box<dyn Fn(&<T as Config>::AccountId) -> u64>

Returns a closure around slashable_balance_of_vote_weight that can be passed around.

This prevents call sites from repeatedly requesting total_issuance from backend. But it is important to be only used while the total issuance is not changing.

Source

pub fn weight_of(who: &<T as Config>::AccountId) -> u64

Same as weight_of_fn, but made for one time use.

Source

pub fn populate_staking_election_testing_benchmarking_only() -> Result<(), &'static str>

Helper function provided to other pallets that want to rely on pallet-stkaing for testing/benchmarking, and wish to populate ElectableStashes, such that a next call (post genesis) to try_plan_new_era works.

This uses GenesisElectionProvider which should always be set to something reasonable and instant.

Source

pub fn plan_new_era(start_session_index: u32)

Plan a new era.

  • Bump the current era storage (which holds the latest planned era).
  • Store start session index for the new planned era.
  • Clean old era information.

The new validator set for this era is stored under ElectableStashes.

Source

pub fn store_stakers_info( exposures: BoundedVec<(<T as Config>::AccountId, Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>), <<T as Config>::ElectionProvider as ElectionProvider>::MaxWinnersPerPage>, new_planned_era: u32, ) -> BoundedVec<<T as Config>::AccountId, <<T as Config>::ElectionProvider as ElectionProvider>::MaxWinnersPerPage>

Process the output of a paged election.

Store staking information for the new planned era of a single election page.

Source

pub fn reward_by_ids( validators_points: impl IntoIterator<Item = (<T as Config>::AccountId, u32)>, )

Add reward points to validators using their stash account ID.

Validators are keyed by stash account ID and must be in the current elected set.

For each element in the iterator the given number of points in u32 is added to the validator, thus duplicates are handled.

At the end of the era each the total payout will be distributed among validator relatively to their points.

COMPLEXITY: Complexity is number_of_validator_to_reward x current_elected_len.

Source

pub fn add_era_stakers( current_era: u32, stash: <T as Config>::AccountId, exposure: Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>, )

Source

pub fn set_slash_reward_fraction(fraction: Perbill)

Source

pub fn get_npos_targets( bounds: DataProviderBounds, ) -> Vec<<T as Config>::AccountId>

Get all the targets associated are eligible for the npos election.

The target snapshot is always single paged.

This function is self-weighing as DispatchClass::Mandatory.

Source

pub fn do_add_nominator( who: &<T as Config>::AccountId, nominations: Nominations<T>, )

This function will add a nominator to the Nominators storage map, and VoterList.

If the nominator already exists, their nominations will be updated.

NOTE: you must ALWAYS use this function to add nominator or update their targets. Any access to Nominators or VoterList outside of this function is almost certainly wrong.

Source

pub fn do_remove_nominator(who: &<T as Config>::AccountId) -> bool

This function will remove a nominator from the Nominators storage map, and VoterList.

Returns true if who was removed from Nominators, otherwise false.

NOTE: you must ALWAYS use this function to remove a nominator from the system. Any access to Nominators or VoterList outside of this function is almost certainly wrong.

Source

pub fn do_add_validator(who: &<T as Config>::AccountId, prefs: ValidatorPrefs)

This function will add a validator to the Validators storage map.

If the validator already exists, their preferences will be updated.

NOTE: you must ALWAYS use this function to add a validator to the system. Any access to Validators or VoterList outside of this function is almost certainly wrong.

Source

pub fn do_remove_validator(who: &<T as Config>::AccountId) -> bool

This function will remove a validator from the Validators storage map.

Returns true if who was removed from Validators, otherwise false.

NOTE: you must ALWAYS use this function to remove a validator from the system. Any access to Validators or VoterList outside of this function is almost certainly wrong.

Source

pub fn eras_stakers( era: u32, account: &<T as Config>::AccountId, ) -> Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>

Returns full exposure of a validator for a given era.

History note: This used to be a getter for old storage item ErasStakers deprecated in v14 and deleted in v17. Since this function is used in the codebase at various places, we kept it as a custom getter that takes care of getting the full exposure of the validator in a backward compatible way.

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn validator_count() -> u32

Get the ideal number of active validators.

Source

pub fn minimum_validator_count() -> u32

Get the minimum number of staking participants before emergency conditions are imposed.

Source

pub fn invulnerables() -> BoundedVec<<T as Config>::AccountId, <T as Config>::MaxInvulnerables>

Get the validators that may never be slashed or forcibly kicked out.

Source

pub fn validators<EncodeLikeAccountId>( account_id: EncodeLikeAccountId, ) -> ValidatorPrefs
where EncodeLikeAccountId: EncodeLike<<T as Config>::AccountId>,

Get the preferences of a given validator.

Source

pub fn nominators<EncodeLikeAccountId>( account_id: EncodeLikeAccountId, ) -> Option<Nominations<T>>
where EncodeLikeAccountId: EncodeLike<<T as Config>::AccountId>,

Get the nomination preferences of a given nominator.

Source

pub fn current_era() -> Option<u32>

Get the current era index.

Source

pub fn active_era() -> Option<ActiveEraInfo>

Get the active era information.

Source

pub fn eras_start_session_index<EncodeLikeEraIndex>( era_index: EncodeLikeEraIndex, ) -> Option<u32>
where EncodeLikeEraIndex: EncodeLike<u32>,

Get the session index at which the era starts for the last Config::HistoryDepth eras.

Source

pub fn claimed_rewards<EncodeLikeEraIndex, EncodeLikeAccountId>( era_index: EncodeLikeEraIndex, account_id: EncodeLikeAccountId, ) -> Vec<u32>
where EncodeLikeEraIndex: EncodeLike<u32>, EncodeLikeAccountId: EncodeLike<<T as Config>::AccountId>,

Get the paged history of claimed rewards by era for given validator.

Source

pub fn eras_validator_prefs<EncodeLikeEraIndex, EncodeLikeAccountId>( era_index: EncodeLikeEraIndex, account_id: EncodeLikeAccountId, ) -> ValidatorPrefs
where EncodeLikeEraIndex: EncodeLike<u32>, EncodeLikeAccountId: EncodeLike<<T as Config>::AccountId>,

Get the preferences of given validator at given era.

Source

pub fn eras_validator_reward<EncodeLikeEraIndex>( era_index: EncodeLikeEraIndex, ) -> Option<<T as Config>::CurrencyBalance>
where EncodeLikeEraIndex: EncodeLike<u32>,

Get the total validator era payout for the last Config::HistoryDepth eras.

Source

pub fn eras_reward_points<EncodeLikeEraIndex>( era_index: EncodeLikeEraIndex, ) -> EraRewardPoints<<T as Config>::AccountId>
where EncodeLikeEraIndex: EncodeLike<u32>,

Get the rewards for the last Config::HistoryDepth eras.

Source

pub fn eras_total_stake<EncodeLikeEraIndex>( era_index: EncodeLikeEraIndex, ) -> <T as Config>::CurrencyBalance
where EncodeLikeEraIndex: EncodeLike<u32>,

Get the total amount staked for the last Config::HistoryDepth eras.

Source

pub fn force_era() -> Forcing

Get the mode of era forcing.

Source

pub fn slash_reward_fraction() -> Perbill

Get the percentage of the slash that is distributed to reporters.

Source

pub fn canceled_payout() -> <T as Config>::CurrencyBalance

Get the amount of canceled slash payout.

Source

pub fn slashing_spans<EncodeLikeAccountId>( account_id: EncodeLikeAccountId, ) -> Option<SlashingSpans>
where EncodeLikeAccountId: EncodeLike<<T as Config>::AccountId>,

Get the slashing spans for given account.

Source

pub fn current_planned_session() -> u32

Get the last planned session scheduled by the session pallet.

Source§

impl<T> Pallet<T>
where T: Config,

Source

pub fn bond( origin: <T as Config>::RuntimeOrigin, value: <T as Config>::CurrencyBalance, payee: RewardDestination<<T as Config>::AccountId>, ) -> Result<(), DispatchError>

Take the origin account as a stash and lock up value of its balance. controller will be the account that controls it.

value must be more than the minimum_balance specified by T::Currency.

The dispatch origin for this call must be Signed by the stash account.

Emits Bonded.

§Complexity
  • Independent of the arguments. Moderate complexity.
  • O(1).
  • Three extra DB entries.

NOTE: Two of the storage writes (Self::bonded, Self::payee) are never cleaned unless the origin falls below existential deposit (or equal to 0) and gets removed as dust.

Source

pub fn bond_extra( origin: <T as Config>::RuntimeOrigin, max_additional: <T as Config>::CurrencyBalance, ) -> Result<(), DispatchError>

Add some extra amount that have appeared in the stash free_balance into the balance up for staking.

The dispatch origin for this call must be Signed by the stash, not the controller.

Use this if there are additional funds in your stash account that you wish to bond. Unlike bond or unbond this function does not impose any limitation on the amount that can be added.

Emits Bonded.

§Complexity
  • Independent of the arguments. Insignificant complexity.
  • O(1).
Source

pub fn unbond( origin: <T as Config>::RuntimeOrigin, value: <T as Config>::CurrencyBalance, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Schedule a portion of the stash to be unlocked ready for transfer out after the bond period ends. If this leaves an amount actively bonded less than asset::existential_deposit, then it is increased to the full amount.

The dispatch origin for this call must be Signed by the controller, not the stash.

Once the unlock period is done, you can call withdraw_unbonded to actually move the funds out of management ready for transfer.

No more than a limited number of unlocking chunks (see MaxUnlockingChunks) can co-exists at the same time. If there are no unlocking chunks slots available Call::withdraw_unbonded is called to remove some of the chunks (if possible).

If a user encounters the InsufficientBond error when calling this extrinsic, they should call chill first in order to free up their bonded funds.

Emits Unbonded.

See also Call::withdraw_unbonded.

Source

pub fn withdraw_unbonded( origin: <T as Config>::RuntimeOrigin, num_slashing_spans: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Remove any unlocked chunks from the unlocking queue from our management.

This essentially frees up that balance to be used by the stash account to do whatever it wants.

The dispatch origin for this call must be Signed by the controller.

Emits Withdrawn.

See also Call::unbond.

§Parameters
  • num_slashing_spans indicates the number of metadata slashing spans to clear when this call results in a complete removal of all the data related to the stash account. In this case, the num_slashing_spans must be larger or equal to the number of slashing spans associated with the stash account in the SlashingSpans storage type, otherwise the call will fail. The call weight is directly proportional to num_slashing_spans.
§Complexity

O(S) where S is the number of slashing spans to remove NOTE: Weight annotation is the kill scenario, we refund otherwise.

Source

pub fn validate( origin: <T as Config>::RuntimeOrigin, prefs: ValidatorPrefs, ) -> Result<(), DispatchError>

Declare the desire to validate for the origin controller.

Effects will be felt at the beginning of the next era.

The dispatch origin for this call must be Signed by the controller, not the stash.

Source

pub fn nominate( origin: <T as Config>::RuntimeOrigin, targets: Vec<<<T as Config>::Lookup as StaticLookup>::Source>, ) -> Result<(), DispatchError>

Declare the desire to nominate targets for the origin controller.

Effects will be felt at the beginning of the next era.

The dispatch origin for this call must be Signed by the controller, not the stash.

§Complexity
  • The transaction’s complexity is proportional to the size of targets (N) which is capped at CompactAssignments::LIMIT (T::MaxNominations).
  • Both the reads and writes follow a similar pattern.
Source

pub fn chill(origin: <T as Config>::RuntimeOrigin) -> Result<(), DispatchError>

Declare no desire to either validate or nominate.

Effects will be felt at the beginning of the next era.

The dispatch origin for this call must be Signed by the controller, not the stash.

§Complexity
  • Independent of the arguments. Insignificant complexity.
  • Contains one read.
  • Writes are limited to the origin account key.
Source

pub fn set_payee( origin: <T as Config>::RuntimeOrigin, payee: RewardDestination<<T as Config>::AccountId>, ) -> Result<(), DispatchError>

(Re-)set the payment target for a controller.

Effects will be felt instantly (as soon as this function is completed successfully).

The dispatch origin for this call must be Signed by the controller, not the stash.

§Complexity
  • O(1)
  • Independent of the arguments. Insignificant complexity.
  • Contains a limited number of reads.
  • Writes are limited to the origin account key.

Source

pub fn set_controller( origin: <T as Config>::RuntimeOrigin, ) -> Result<(), DispatchError>

(Re-)sets the controller of a stash to the stash itself. This function previously accepted a controller argument to set the controller to an account other than the stash itself. This functionality has now been removed, now only setting the controller to the stash, if it is not already.

Effects will be felt instantly (as soon as this function is completed successfully).

The dispatch origin for this call must be Signed by the stash, not the controller.

§Complexity

O(1)

  • Independent of the arguments. Insignificant complexity.
  • Contains a limited number of reads.
  • Writes are limited to the origin account key.
Source

pub fn set_validator_count( origin: <T as Config>::RuntimeOrigin, new: u32, ) -> Result<(), DispatchError>

Sets the ideal number of validators.

The dispatch origin must be Root.

§Complexity

O(1)

Source

pub fn increase_validator_count( origin: <T as Config>::RuntimeOrigin, additional: u32, ) -> Result<(), DispatchError>

Increments the ideal number of validators up to maximum of T::MaxValidatorSet.

The dispatch origin must be Root.

§Complexity

Same as Self::set_validator_count.

Source

pub fn scale_validator_count( origin: <T as Config>::RuntimeOrigin, factor: Percent, ) -> Result<(), DispatchError>

Scale up the ideal number of validators by a factor up to maximum of T::MaxValidatorSet.

The dispatch origin must be Root.

§Complexity

Same as Self::set_validator_count.

Source

pub fn force_no_eras( origin: <T as Config>::RuntimeOrigin, ) -> Result<(), DispatchError>

Force there to be no new eras indefinitely.

The dispatch origin must be Root.

§Warning

The election process starts multiple blocks before the end of the era. Thus the election process may be ongoing when this is called. In this case the election will continue until the next era is triggered.

§Complexity
  • No arguments.
  • Weight: O(1)
Source

pub fn force_new_era( origin: <T as Config>::RuntimeOrigin, ) -> Result<(), DispatchError>

Force there to be a new era at the end of the next session. After this, it will be reset to normal (non-forced) behaviour.

The dispatch origin must be Root.

§Warning

The election process starts multiple blocks before the end of the era. If this is called just before a new era is triggered, the election process may not have enough blocks to get a result.

§Complexity
  • No arguments.
  • Weight: O(1)
Source

pub fn set_invulnerables( origin: <T as Config>::RuntimeOrigin, invulnerables: Vec<<T as Config>::AccountId>, ) -> Result<(), DispatchError>

Set the validators who cannot be slashed (if any).

The dispatch origin must be Root.

Source

pub fn force_unstake( origin: <T as Config>::RuntimeOrigin, stash: <T as Config>::AccountId, num_slashing_spans: u32, ) -> Result<(), DispatchError>

Force a current staker to become completely unstaked, immediately.

The dispatch origin must be Root.

§Parameters
Source

pub fn force_new_era_always( origin: <T as Config>::RuntimeOrigin, ) -> Result<(), DispatchError>

Force there to be a new era at the end of sessions indefinitely.

The dispatch origin must be Root.

§Warning

The election process starts multiple blocks before the end of the era. If this is called just before a new era is triggered, the election process may not have enough blocks to get a result.

Source

pub fn cancel_deferred_slash( origin: <T as Config>::RuntimeOrigin, era: u32, slash_keys: Vec<(<T as Config>::AccountId, Perbill, u32)>, ) -> Result<(), DispatchError>

Cancels scheduled slashes for a given era before they are applied.

This function allows T::AdminOrigin to selectively remove pending slashes from the UnappliedSlashes storage, preventing their enactment.

§Parameters
  • era: The staking era for which slashes were deferred.
  • slash_keys: A list of slash keys identifying the slashes to remove. This is a tuple of (stash, slash_fraction, page_index).
Source

pub fn payout_stakers( origin: <T as Config>::RuntimeOrigin, validator_stash: <T as Config>::AccountId, era: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Pay out next page of the stakers behind a validator for the given era.

  • validator_stash is the stash account of the validator.
  • era may be any era between [current_era - history_depth; current_era].

The origin of this call must be Signed. Any account can call this function, even if it is not one of the stakers.

The reward payout could be paged in case there are too many nominators backing the validator_stash. This call will payout unpaid pages in an ascending order. To claim a specific page, use payout_stakers_by_page.`

If all pages are claimed, it returns an error InvalidPage.

Source

pub fn rebond( origin: <T as Config>::RuntimeOrigin, value: <T as Config>::CurrencyBalance, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Rebond a portion of the stash scheduled to be unlocked.

The dispatch origin must be signed by the controller.

§Complexity
  • Time complexity: O(L), where L is unlocking chunks
  • Bounded by MaxUnlockingChunks.
Source

pub fn reap_stash( origin: <T as Config>::RuntimeOrigin, stash: <T as Config>::AccountId, num_slashing_spans: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Remove all data structures concerning a staker/stash once it is at a state where it can be considered dust in the staking system. The requirements are:

  1. the total_balance of the stash is below existential deposit.
  2. or, the ledger.total of the stash is below existential deposit.
  3. or, existential deposit is zero and either total_balance or ledger.total is zero.

The former can happen in cases like a slash; the latter when a fully unbonded account is still receiving staking rewards in RewardDestination::Staked.

It can be called by anyone, as long as stash meets the above requirements.

Refunds the transaction fees upon successful execution.

§Parameters
Source

pub fn kick( origin: <T as Config>::RuntimeOrigin, who: Vec<<<T as Config>::Lookup as StaticLookup>::Source>, ) -> Result<(), DispatchError>

Remove the given nominations from the calling validator.

Effects will be felt at the beginning of the next era.

The dispatch origin for this call must be Signed by the controller, not the stash.

  • who: A list of nominator stash accounts who are nominating this validator which should no longer be nominating this validator.

Note: Making this call only makes sense if you first set the validator preferences to block any further nominations.

Source

pub fn set_staking_configs( origin: <T as Config>::RuntimeOrigin, min_nominator_bond: ConfigOp<<T as Config>::CurrencyBalance>, min_validator_bond: ConfigOp<<T as Config>::CurrencyBalance>, max_nominator_count: ConfigOp<u32>, max_validator_count: ConfigOp<u32>, chill_threshold: ConfigOp<Percent>, min_commission: ConfigOp<Perbill>, max_staked_rewards: ConfigOp<Percent>, ) -> Result<(), DispatchError>

Update the various staking configurations .

  • min_nominator_bond: The minimum active bond needed to be a nominator.
  • min_validator_bond: The minimum active bond needed to be a validator.
  • max_nominator_count: The max number of users who can be a nominator at once. When set to None, no limit is enforced.
  • max_validator_count: The max number of users who can be a validator at once. When set to None, no limit is enforced.
  • chill_threshold: The ratio of max_nominator_count or max_validator_count which should be filled in order for the chill_other transaction to work.
  • min_commission: The minimum amount of commission that each validators must maintain. This is checked only upon calling validate. Existing validators are not affected.

RuntimeOrigin must be Root to call this function.

NOTE: Existing nominators and validators will not be affected by this update. to kick people under the new limits, chill_other should be called.

Source

pub fn chill_other( origin: <T as Config>::RuntimeOrigin, stash: <T as Config>::AccountId, ) -> Result<(), DispatchError>

Declare a controller to stop participating as either a validator or nominator.

Effects will be felt at the beginning of the next era.

The dispatch origin for this call must be Signed, but can be called by anyone.

If the caller is the same as the controller being targeted, then no further checks are enforced, and this function behaves just like chill.

If the caller is different than the controller being targeted, the following conditions must be met:

  • controller must belong to a nominator who has become non-decodable,

Or:

  • A ChillThreshold must be set and checked which defines how close to the max nominators or validators we must reach before users can start chilling one-another.
  • A MaxNominatorCount and MaxValidatorCount must be set which is used to determine how close we are to the threshold.
  • A MinNominatorBond and MinValidatorBond must be set and checked, which determines if this is a person that should be chilled because they have not met the threshold bond required.

This can be helpful if bond requirements are updated, and we need to remove old users who do not satisfy these requirements.

Source

pub fn force_apply_min_commission( origin: <T as Config>::RuntimeOrigin, validator_stash: <T as Config>::AccountId, ) -> Result<(), DispatchError>

Force a validator to have at least the minimum commission. This will not affect a validator who already has a commission greater than or equal to the minimum. Any account can call this.

Source

pub fn set_min_commission( origin: <T as Config>::RuntimeOrigin, new: Perbill, ) -> Result<(), DispatchError>

Sets the minimum amount of commission that each validators must maintain.

This call has lower privilege requirements than set_staking_config and can be called by the T::AdminOrigin. Root can always call this.

Source

pub fn payout_stakers_by_page( origin: <T as Config>::RuntimeOrigin, validator_stash: <T as Config>::AccountId, era: u32, page: u32, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Pay out a page of the stakers behind a validator for the given era and page.

  • validator_stash is the stash account of the validator.
  • era may be any era between [current_era - history_depth; current_era].
  • page is the page index of nominators to pay out with value between 0 and num_nominators / T::MaxExposurePageSize.

The origin of this call must be Signed. Any account can call this function, even if it is not one of the stakers.

If a validator has more than Config::MaxExposurePageSize nominators backing them, then the list of nominators is paged, with each page being capped at [Config::MaxExposurePageSize.] If a validator has more than one page of nominators, the call needs to be made for each page separately in order for all the nominators backing a validator to receive the reward. The nominators are not sorted across pages and so it should not be assumed the highest staker would be on the topmost page and vice versa. If rewards are not claimed in Config::HistoryDepth eras, they are lost.

Source

pub fn update_payee( origin: <T as Config>::RuntimeOrigin, controller: <T as Config>::AccountId, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Migrates an account’s RewardDestination::Controller to RewardDestination::Account(controller).

Effects will be felt instantly (as soon as this function is completed successfully).

This will waive the transaction fee if the payee is successfully migrated.

Source

pub fn deprecate_controller_batch( origin: <T as Config>::RuntimeOrigin, controllers: BoundedVec<<T as Config>::AccountId, <T as Config>::MaxControllersInDeprecationBatch>, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Updates a batch of controller accounts to their corresponding stash account if they are not the same. Ignores any controller accounts that do not exist, and does not operate if the stash and controller are already the same.

Effects will be felt instantly (as soon as this function is completed successfully).

The dispatch origin must be T::AdminOrigin.

Source

pub fn restore_ledger( origin: <T as Config>::RuntimeOrigin, stash: <T as Config>::AccountId, maybe_controller: Option<<T as Config>::AccountId>, maybe_total: Option<<T as Config>::CurrencyBalance>, maybe_unlocking: Option<BoundedVec<UnlockChunk<<T as Config>::CurrencyBalance>, <T as Config>::MaxUnlockingChunks>>, ) -> Result<(), DispatchError>

Restores the state of a ledger which is in an inconsistent state.

The requirements to restore a ledger are the following:

  • The stash is bonded; or
  • The stash is not bonded but it has a staking lock left behind; or
  • If the stash has an associated ledger and its state is inconsistent; or
  • If the ledger is not corrupted but its staking lock is out of sync.

The maybe_* input parameters will overwrite the corresponding data and metadata of the ledger associated with the stash. If the input parameters are not set, the ledger will be reset values from on-chain state.

Source

pub fn migrate_currency( origin: <T as Config>::RuntimeOrigin, stash: <T as Config>::AccountId, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Migrates permissionlessly a stash from locks to holds.

This removes the old lock on the stake and creates a hold on it atomically. If all stake cannot be held, the best effort is made to hold as much as possible. The remaining stake is removed from the ledger.

The fee is waived if the migration is successful.

Source

pub fn apply_slash( origin: <T as Config>::RuntimeOrigin, slash_era: u32, slash_key: (<T as Config>::AccountId, Perbill, u32), ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Manually applies a deferred slash for a given era.

Normally, slashes are automatically applied shortly after the start of the slash_era. This function exists as a fallback mechanism in case slashes were not applied due to unexpected reasons. It allows anyone to manually apply an unapplied slash.

§Parameters
  • slash_era: The staking era in which the slash was originally scheduled.
  • slash_key: A unique identifier for the slash, represented as a tuple:
    • stash: The stash account of the validator being slashed.
    • slash_fraction: The fraction of the stake that was slashed.
    • page_index: The index of the exposure page being processed.
§Behavior
  • The function is permissionless—anyone can call it.
  • The slash_era must be the current era or a past era. If it is in the future, the call fails with EraNotStarted.
  • The fee is waived if the slash is successfully applied.
§TODO: Future Improvement
  • Implement an off-chain worker (OCW) task to automatically apply slashes when there is unused block space, improving efficiency.
Source

pub fn manual_slash( origin: <T as Config>::RuntimeOrigin, validator_stash: <T as Config>::AccountId, era: u32, slash_fraction: Perbill, ) -> Result<(), DispatchError>

This function allows governance to manually slash a validator and is a fallback mechanism.

The dispatch origin must be T::AdminOrigin.

§Parameters
  • validator_stash - The stash account of the validator to slash.
  • era - The era in which the validator was in the active set.
  • slash_fraction - The percentage of the stake to slash, expressed as a Perbill.
§Behavior

The slash will be applied using the standard slashing mechanics, respecting the configured SlashDeferDuration.

This means:

  • If the validator was already slashed by a higher percentage for the same era, this slash will have no additional effect.
  • If the validator was previously slashed by a lower percentage, only the difference will be applied.
  • The slash will be deferred by SlashDeferDuration eras before being enacted.

Trait Implementations

Source§

impl<T> BeforeAllRuntimeMigrations for Pallet<T>
where T: Config,

Source§

fn before_all_runtime_migrations() -> Weight

Something that should happen before runtime migrations are executed.
Source§

impl<T> Benchmarking for Pallet<T>
where T: Config + Config,

Source§

fn benchmarks(extra: bool) -> Vec<BenchmarkMetadata>

Get the benchmarks available for this pallet. Generally there is one benchmark per extrinsic, so these are sometimes just called “extrinsics”. Read more
Source§

fn run_benchmark( extrinsic: &[u8], c: &[(BenchmarkParameter, u32)], whitelist: &[TrackedStorageKey], verify: bool, internal_repeats: u32, ) -> Result<Vec<BenchmarkResult>, BenchmarkError>

Run the benchmarks for this pallet.
Source§

impl<T> Callable<T> for Pallet<T>
where T: Config,

Source§

impl<T> Clone for Pallet<T>

Source§

fn clone(&self) -> Pallet<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for Pallet<T>

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> DispatchViewFunction for Pallet<T>
where T: Config,

Source§

fn dispatch_view_function<O>( id: &ViewFunctionId, input: &mut &[u8], output: &mut O, ) -> Result<(), ViewFunctionDispatchError>
where O: Output,

Source§

impl<T> ElectionDataProvider for Pallet<T>
where T: Config,

Source§

type AccountId = <T as Config>::AccountId

The account identifier type.
Source§

type BlockNumber = <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number

The block number type.
Source§

type MaxVotesPerVoter = <<T as Config>::NominationsQuota as NominationsQuota<<T as Config>::CurrencyBalance>>::MaxNominations

Maximum number of votes per voter that this data provider is providing.
Source§

fn desired_targets() -> Result<u32, &'static str>

The number of targets to elect. Read more
Source§

fn electing_voters( bounds: DataProviderBounds, page: u32, ) -> Result<Vec<(<Pallet<T> as ElectionDataProvider>::AccountId, u64, BoundedVec<<Pallet<T> as ElectionDataProvider>::AccountId, <Pallet<T> as ElectionDataProvider>::MaxVotesPerVoter>)>, &'static str>

All the voters that participate in the election associated with page page, thus “electing”. Read more
Source§

fn electing_voters_stateless( bounds: DataProviderBounds, ) -> Result<Vec<(<Pallet<T> as ElectionDataProvider>::AccountId, u64, BoundedVec<<Pallet<T> as ElectionDataProvider>::AccountId, <Pallet<T> as ElectionDataProvider>::MaxVotesPerVoter>)>, &'static str>

A state-less version of Self::electing_voters.
Source§

fn electable_targets( bounds: DataProviderBounds, page: u32, ) -> Result<Vec<<T as Config>::AccountId>, &'static str>

Returns the possible targets for the election associated with the provided page, i.e. the targets that could become elected, thus “electable”. Read more
Source§

fn next_election_prediction( now: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number

Provide a best effort prediction about when the next election is about to happen. Read more
Source§

fn set_next_election(to: u32)

Source§

fn add_voter( voter: <T as Config>::AccountId, weight: u64, targets: BoundedVec<<T as Config>::AccountId, <Pallet<T> as ElectionDataProvider>::MaxVotesPerVoter>, )

Utility function only to be used in benchmarking scenarios, to be implemented optionally, else a noop. Read more
Source§

fn add_target(target: <T as Config>::AccountId)

Utility function only to be used in benchmarking scenarios, to be implemented optionally, else a noop. Read more
Source§

fn clear()

Clear all voters and targets.
Source§

fn put_snapshot( voters: Vec<(<Pallet<T> as ElectionDataProvider>::AccountId, u64, BoundedVec<<Pallet<T> as ElectionDataProvider>::AccountId, <Pallet<T> as ElectionDataProvider>::MaxVotesPerVoter>)>, targets: Vec<<T as Config>::AccountId>, target_stake: Option<u64>, )

Utility function only to be used in benchmarking scenarios, to be implemented optionally, else a noop.
Source§

fn set_desired_targets(count: u32)

Source§

fn electable_targets_stateless( bounds: DataProviderBounds, ) -> Result<Vec<Self::AccountId>, &'static str>

A state-less version of Self::electable_targets. Read more
Source§

impl<T> EventHandler<<T as Config>::AccountId, <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config + Config + Config,

Add reward points to block authors:

  • 20 points to the block producer for producing a (non-uncle) block,
Source§

fn note_author(author: <T as Config>::AccountId)

Note that the given account ID is the author of the current block.
Source§

impl<T> GetStorageVersion for Pallet<T>
where T: Config,

Source§

type InCodeStorageVersion = StorageVersion

This type is generated by the pallet macro. Read more
Source§

fn in_code_storage_version() -> <Pallet<T> as GetStorageVersion>::InCodeStorageVersion

Returns the in-code storage version as specified in the storage_version attribute, or NoStorageVersionSet if the attribute is missing.
Source§

fn on_chain_storage_version() -> StorageVersion

Returns the storage version of the pallet as last set in the actual on-chain storage.
Source§

fn current_storage_version() -> Self::InCodeStorageVersion

👎Deprecated: This method has been renamed to in_code_storage_version and will be removed after March 2024.
DEPRECATED: Use Self::current_storage_version instead. Read more
Source§

impl<T> Hooks<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_initialize( now: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight

Start fetching the election pages Pages blocks before the election prediction, so that the ElectableStashes has been populated with all validators from all pages at the time of the election.

Source§

fn on_finalize( _n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

Block finalization hook. This is called at the very end of block execution. Read more
Source§

fn integrity_test()

Check the integrity of this pallet’s configuration. Read more
Source§

fn try_state( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Result<(), DispatchError>

Execute the sanity checks of this pallet, per block. Read more
Source§

fn on_idle(_n: BlockNumber, _remaining_weight: Weight) -> Weight

Hook to consume a block’s idle time. This will run when the block is being finalized (before Hooks::on_finalize). Read more
Source§

fn on_poll(_n: BlockNumber, _weight: &mut WeightMeter)

A hook to run logic after inherent application. Read more
Source§

fn on_runtime_upgrade() -> Weight

Hook executed when a code change (aka. a “runtime upgrade”) is detected by the FRAME Executive pallet. Read more
Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Execute some pre-checks prior to a runtime upgrade. Read more
Source§

fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError>

Execute some post-checks after a runtime upgrade. Read more
Source§

fn offchain_worker(_n: BlockNumber)

Implementing this function on a pallet allows you to perform long-running tasks that are dispatched as separate threads, and entirely independent of the main blockchain execution. Read more
Source§

impl<T> IntegrityTest for Pallet<T>
where T: Config,

Source§

impl<T> OffchainWorker<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn offchain_worker( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

This function is being called after every block import (when fully synced). Read more
Source§

impl<T> OnFinalize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_finalize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, )

Source§

impl<T> OnGenesis for Pallet<T>
where T: Config,

Source§

fn on_genesis()

Something that should happen at genesis.
Source§

impl<T> OnIdle<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_idle( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, remaining_weight: Weight, ) -> Weight

Source§

impl<T> OnInitialize<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_initialize( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, ) -> Weight

Source§

impl<T> OnOffenceHandler<<T as Config>::AccountId, (<T as Config>::ValidatorId, <T as Config>::FullIdentification), Weight> for Pallet<T>

This is intended to be used with FilterHistoricalOffences.

Source§

fn on_offence( offenders: &[OffenceDetails<<T as Config>::AccountId, (<T as Config>::ValidatorId, <T as Config>::FullIdentification)>], slash_fractions: &[Perbill], slash_session: u32, ) -> Weight

When an offence is reported, it is split into pages and put in the offence queue. As offence queue is processed, computed slashes are queued to be applied after the SlashDeferDuration.

Source§

impl<T> OnPoll<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn on_poll( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, weight: &mut WeightMeter, )

Code to execute every now and then at the beginning of the block after inherent application. Read more
Source§

impl<T> OnRuntimeUpgrade for Pallet<T>
where T: Config,

Source§

fn on_runtime_upgrade() -> Weight

Source§

fn pre_upgrade() -> Result<Vec<u8>, DispatchError>

Source§

fn post_upgrade(state: Vec<u8>) -> Result<(), DispatchError>

Source§

fn try_on_runtime_upgrade(checks: bool) -> Result<Weight, DispatchError>

The expected and default behavior of this method is to handle executing pre_upgrade -> on_runtime_upgrade -> post_upgrade hooks for a migration. Read more
Source§

impl<T> PalletInfoAccess for Pallet<T>
where T: Config,

Source§

fn index() -> usize

Index of the pallet as configured in the runtime.
Source§

fn name() -> &'static str

Name of the pallet as configured in the runtime.
Source§

fn name_hash() -> [u8; 16]

Two128 hash of name.
Source§

fn module_name() -> &'static str

Name of the Rust module containing the pallet.
Source§

fn crate_version() -> CrateVersion

Version of the crate containing the pallet.
Source§

impl<T> PalletsInfoAccess for Pallet<T>
where T: Config,

Source§

fn count() -> usize

The number of pallets’ information that this type represents. Read more
Source§

fn infos() -> Vec<PalletInfoData>

All of the pallets’ information that this type represents.
Source§

impl<T> PartialEq for Pallet<T>

Source§

fn eq(&self, other: &Pallet<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> ScoreProvider<<T as Config>::AccountId> for Pallet<T>
where T: Config,

Source§

type Score = u64

Source§

fn score( who: &<T as Config>::AccountId, ) -> <Pallet<T> as ScoreProvider<<T as Config>::AccountId>>::Score

Get the current Score of who.
Source§

fn set_score_of( who: &<T as Config>::AccountId, weight: <Pallet<T> as ScoreProvider<<T as Config>::AccountId>>::Score, )

For tests, benchmarks and fuzzing, set the score.
Source§

impl<T> SessionManager<<T as Config>::AccountId> for Pallet<T>
where T: Config,

In this implementation new_session(session) must be called before end_session(session-1) i.e. the new session must be planned before the ending of the previous session.

Once the first new_session is planned, all session must start and then end in order, though some session can lag in between the newest session planned and the latest session started.

Source§

fn new_session(new_index: u32) -> Option<Vec<<T as Config>::AccountId>>

Plan a new session, and optionally provide the new validator set. Read more
Source§

fn new_session_genesis(new_index: u32) -> Option<Vec<<T as Config>::AccountId>>

Same as new_session, but it this should only be called at genesis. Read more
Source§

fn start_session(start_index: u32)

Start an already planned session. Read more
Source§

fn end_session(end_index: u32)

End the session. Read more
Source§

impl<T> SessionManager<<T as Config>::AccountId, ()> for Pallet<T>
where T: Config,

Source§

fn new_session(new_index: u32) -> Option<Vec<(<T as Config>::AccountId, ())>>

If there was a validator set change, its returns the set of new validators along with their full identifications.
Source§

fn new_session_genesis( new_index: u32, ) -> Option<Vec<(<T as Config>::AccountId, ())>>

Source§

fn start_session(start_index: u32)

Source§

fn end_session(end_index: u32)

Source§

impl<T> SessionManager<<T as Config>::AccountId, Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>> for Pallet<T>
where T: Config,

Source§

fn new_session( new_index: u32, ) -> Option<Vec<(<T as Config>::AccountId, Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>)>>

If there was a validator set change, its returns the set of new validators along with their full identifications.
Source§

fn new_session_genesis( new_index: u32, ) -> Option<Vec<(<T as Config>::AccountId, Exposure<<T as Config>::AccountId, <T as Config>::CurrencyBalance>)>>

Source§

fn start_session(start_index: u32)

Source§

fn end_session(end_index: u32)

Source§

impl<T> StakingInterface for Pallet<T>
where T: Config,

Source§

fn is_virtual_staker(who: &<T as Config>::AccountId) -> bool

Whether who is a virtual staker whose funds are managed by another pallet.

There is an assumption that, this account is keyless and managed by another pallet in the runtime. Hence, it can never sign its own transactions.

Source§

type AccountId = <T as Config>::AccountId

AccountId type used by the staking system.
Source§

type Balance = <T as Config>::CurrencyBalance

Balance type used by the staking system.
Source§

type CurrencyToVote = <T as Config>::CurrencyToVote

Means of converting Currency to VoteWeight.
Source§

fn minimum_nominator_bond() -> <Pallet<T> as StakingInterface>::Balance

The minimum amount required to bond in order to set nomination intentions. This does not necessarily mean the nomination will be counted in an election, but instead just enough to be stored as a nominator. In other words, this is the minimum amount to register the intention to nominate.
Source§

fn minimum_validator_bond() -> <Pallet<T> as StakingInterface>::Balance

The minimum amount required to bond in order to set validation intentions.
Source§

fn stash_by_ctrl( controller: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<<Pallet<T> as StakingInterface>::AccountId, DispatchError>

Return a stash account that is controlled by a controller. Read more
Source§

fn bonding_duration() -> u32

Number of eras that staked funds must remain bonded for.
Source§

fn current_era() -> u32

The current era index. Read more
Source§

fn stake( who: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<Stake<<T as Config>::CurrencyBalance>, DispatchError>

Returns the Stake of who.
Source§

fn bond_extra( who: &<Pallet<T> as StakingInterface>::AccountId, extra: <Pallet<T> as StakingInterface>::Balance, ) -> Result<(), DispatchError>

Bond some extra amount in who’s free balance against the active bonded balance of the account. The amount extra actually bonded will never be more than who’s free balance.
Source§

fn unbond( who: &<Pallet<T> as StakingInterface>::AccountId, value: <Pallet<T> as StakingInterface>::Balance, ) -> Result<(), DispatchError>

Schedule a portion of the active bonded balance to be unlocked at era Self::current_era + Self::bonding_duration. Read more
Source§

fn set_payee( stash: &<Pallet<T> as StakingInterface>::AccountId, reward_acc: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<(), DispatchError>

Set the reward destination for the ledger associated with the stash.
Source§

fn chill( who: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<(), DispatchError>

Chill who.
Source§

fn withdraw_unbonded( who: <Pallet<T> as StakingInterface>::AccountId, num_slashing_spans: u32, ) -> Result<bool, DispatchError>

Unlock any funds schedule to unlock before or at the current era. Read more
Source§

fn bond( who: &<Pallet<T> as StakingInterface>::AccountId, value: <Pallet<T> as StakingInterface>::Balance, payee: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<(), DispatchError>

Bond (lock) value of who’s balance, while forwarding any rewards to payee.
Source§

fn nominate( who: &<Pallet<T> as StakingInterface>::AccountId, targets: Vec<<Pallet<T> as StakingInterface>::AccountId>, ) -> Result<(), DispatchError>

Have who nominate validators.
Source§

fn desired_validator_count() -> u32

The ideal number of active validators.
Source§

fn election_ongoing() -> bool

Whether or not there is an ongoing election.
Source§

fn force_unstake( who: <Pallet<T> as StakingInterface>::AccountId, ) -> Result<(), DispatchError>

Force a current staker to become completely unstaked, immediately.
Source§

fn is_exposed_in_era( who: &<Pallet<T> as StakingInterface>::AccountId, era: &u32, ) -> bool

Checks whether an account staker has been exposed in an era.
Source§

fn status( who: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<StakerStatus<<Pallet<T> as StakingInterface>::AccountId>, DispatchError>

Return the status of the given staker, Err if not staked at all.
Source§

fn slash_reward_fraction() -> Perbill

Returns the fraction of the slash to be rewarded to reporter.
Source§

fn nominations( who: &<Pallet<T> as StakingInterface>::AccountId, ) -> Option<Vec<<T as Config>::AccountId>>

Get the nominations of a stash, if they are a nominator, None otherwise.
Source§

fn add_era_stakers( current_era: &u32, stash: &<T as Config>::AccountId, exposures: Vec<(<Pallet<T> as StakingInterface>::AccountId, <Pallet<T> as StakingInterface>::Balance)>, )

Source§

fn set_current_era(era: u32)

Source§

fn max_exposure_page_size() -> u32

Source§

fn total_stake(who: &Self::AccountId) -> Result<Self::Balance, DispatchError>

Total stake of a staker, Err if not a staker.
Source§

fn active_stake(who: &Self::AccountId) -> Result<Self::Balance, DispatchError>

Total active portion of a staker’s Stake, Err if not a staker.
Source§

fn is_unbonding(who: &Self::AccountId) -> Result<bool, DispatchError>

Returns whether a staker is unbonding, Err if not a staker at all.
Source§

fn fully_unbond(who: &Self::AccountId) -> Result<(), DispatchError>

Returns whether a staker is FULLY unbonding, Err if not a staker at all.
Source§

fn is_validator(who: &Self::AccountId) -> bool

Checks whether or not this is a validator account.
Source§

impl<T> StakingUnchecked for Pallet<T>
where T: Config,

Source§

fn virtual_bond( keyless_who: &<Pallet<T> as StakingInterface>::AccountId, value: <Pallet<T> as StakingInterface>::Balance, payee: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<(), DispatchError>

Virtually bonds keyless_who to payee with value.

The payee must not be the same as the keyless_who.

Source§

fn migrate_to_direct_staker(who: &<Pallet<T> as StakingInterface>::AccountId)

Only meant to be used in tests.

Source§

fn migrate_to_virtual_staker( who: &<Pallet<T> as StakingInterface>::AccountId, ) -> Result<(), DispatchError>

Migrate an existing staker to a virtual staker. Read more
Source§

impl<T> StorageInfoTrait for Pallet<T>
where T: Config,

Source§

impl<T> TryDecodeEntireStorage for Pallet<T>
where T: Config,

Source§

fn try_decode_entire_state() -> Result<usize, Vec<TryDecodeEntireStorageError>>

Decode the entire data under the given storage, returning Ok(bytes_decoded) if success.
Source§

impl<T> TryState<<<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number> for Pallet<T>
where T: Config,

Source§

fn try_state( n: <<<T as Config>::Block as HeaderProvider>::HeaderT as Header>::Number, _s: Select, ) -> Result<(), DispatchError>

Execute the state checks.
Source§

impl<T> ViewFunctionIdPrefix for Pallet<T>
where T: Config,

Source§

fn prefix() -> [u8; 16]

Source§

impl<T> WhitelistedStorageKeys for Pallet<T>
where T: Config,

Source§

fn whitelisted_storage_keys() -> Vec<TrackedStorageKey>

Returns a Vec<TrackedStorageKey> indicating the storage keys that should be whitelisted during benchmarking. This means that those keys will be excluded from the benchmarking performance calculation.
Source§

impl<T> Eq for Pallet<T>