referrerpolicy=no-referrer-when-downgrade
westend_runtime

Type Alias NominationPools

Source
pub type NominationPools = Pallet<Runtime>;

Aliased Type§

struct NominationPools(/* private fields */);

Implementations

Source§

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

Source

pub fn join( origin: <T as Config>::RuntimeOrigin, amount: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, pool_id: u32, ) -> Result<(), DispatchError>

Stake funds with a pool. The amount to bond is delegated (or transferred based on adapter::StakeStrategyType) from the member to the pool account and immediately increases the pool’s bond.

The method of transferring the amount to the pool account is determined by adapter::StakeStrategyType. If the pool is configured to use adapter::StakeStrategyType::Delegate, the funds remain in the account of the origin, while the pool gains the right to use these funds for staking.

§Note
  • An account can only be a member of a single pool.
  • An account cannot join the same pool multiple times.
  • This call will not dust the member account, so the member must have at least existential deposit + amount in their account.
  • Only a pool with PoolState::Open can be joined
Source

pub fn bond_extra( origin: <T as Config>::RuntimeOrigin, extra: BondExtra<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, ) -> Result<(), DispatchError>

Bond extra more funds from origin into the pool to which they already belong.

Additional funds can come from either the free balance of the account, of from the accumulated rewards, see BondExtra.

Bonding extra funds implies an automatic payout of all pending rewards as well. See bond_extra_other to bond pending rewards of other members.

Source

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

A bonded member can use this to claim their payout based on the rewards that the pool has accumulated since their last claimed payout (OR since joining if this is their first time claiming rewards). The payout will be transferred to the member’s account.

The member will earn rewards pro rata based on the members stake vs the sum of the members in the pools stake. Rewards do not “expire”.

See claim_payout_other to claim rewards on behalf of some other pool member.

Source

pub fn unbond( origin: <T as Config>::RuntimeOrigin, member_account: <<T as Config>::Lookup as StaticLookup>::Source, unbonding_points: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, ) -> Result<(), DispatchError>

Unbond up to unbonding_points of the member_account’s funds from the pool. It implicitly collects the rewards one last time, since not doing so would mean some rewards would be forfeited.

Under certain conditions, this call can be dispatched permissionlessly (i.e. by any account).

§Conditions for a permissionless dispatch.
  • The pool is blocked and the caller is either the root or bouncer. This is refereed to as a kick.
  • The pool is destroying and the member is not the depositor.
  • The pool is destroying, the member is the depositor and no other members are in the pool.
§Conditions for permissioned dispatch (i.e. the caller is also the

member_account):

  • The caller is not the depositor.
  • The caller is the depositor, the pool is destroying and no other members are in the pool.
§Note

If there are too many unlocking chunks to unbond with the pool account, Call::pool_withdraw_unbonded can be called to try and minimize unlocking chunks. The StakingInterface::unbond will implicitly call Call::pool_withdraw_unbonded to try to free chunks if necessary (ie. if unbound was called and no unlocking chunks are available). However, it may not be possible to release the current unlocking chunks, in which case, the result of this call will likely be the NoMoreChunks error from the staking system.

Source

pub fn pool_withdraw_unbonded( origin: <T as Config>::RuntimeOrigin, pool_id: u32, num_slashing_spans: u32, ) -> Result<(), DispatchError>

Call withdraw_unbonded for the pools account. This call can be made by any account.

This is useful if there are too many unlocking chunks to call unbond, and some can be cleared by withdrawing. In the case there are too many unlocking chunks, the user would probably see an error like NoMoreChunks emitted from the staking system when they attempt to unbond.

Source

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

Withdraw unbonded funds from member_account. If no bonded funds can be unbonded, an error is returned.

Under certain conditions, this call can be dispatched permissionlessly (i.e. by any account).

§Conditions for a permissionless dispatch
  • The pool is in destroy mode and the target is not the depositor.
  • The target is the depositor and they are the only member in the sub pools.
  • The pool is blocked and the caller is either the root or bouncer.
§Conditions for permissioned dispatch
  • The caller is the target and they are not the depositor.
§Note
  • If the target is the depositor, the pool will be destroyed.
  • If the pool has any pending slash, we also try to slash the member before letting them withdraw. This calculation adds some weight overhead and is only defensive. In reality, pool slashes must have been already applied via permissionless Call::apply_slash.
Source

pub fn create( origin: <T as Config>::RuntimeOrigin, amount: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, root: <<T as Config>::Lookup as StaticLookup>::Source, nominator: <<T as Config>::Lookup as StaticLookup>::Source, bouncer: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<(), DispatchError>

Create a new delegation pool.

§Arguments
  • amount - The amount of funds to delegate to the pool. This also acts of a sort of deposit since the pools creator cannot fully unbond funds until the pool is being destroyed.
  • index - A disambiguation index for creating the account. Likely only useful when creating multiple pools in the same extrinsic.
  • root - The account to set as PoolRoles::root.
  • nominator - The account to set as the PoolRoles::nominator.
  • bouncer - The account to set as the PoolRoles::bouncer.
§Note

In addition to amount, the caller will transfer the existential deposit; so the caller needs at have at least amount + existential_deposit transferable.

Source

pub fn create_with_pool_id( origin: <T as Config>::RuntimeOrigin, amount: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, root: <<T as Config>::Lookup as StaticLookup>::Source, nominator: <<T as Config>::Lookup as StaticLookup>::Source, bouncer: <<T as Config>::Lookup as StaticLookup>::Source, pool_id: u32, ) -> Result<(), DispatchError>

Create a new delegation pool with a previously used pool id

§Arguments

same as create with the inclusion of

  • pool_id - `A valid PoolId.
Source

pub fn nominate( origin: <T as Config>::RuntimeOrigin, pool_id: u32, validators: Vec<<T as Config>::AccountId>, ) -> Result<(), DispatchError>

Nominate on behalf of the pool.

The dispatch origin of this call must be signed by the pool nominator or the pool root role.

This directly forwards the call to an implementation of StakingInterface (e.g., pallet-staking) through Config::StakeAdapter, on behalf of the bonded pool.

§Note

In addition to a root or nominator role of origin, the pool’s depositor needs to have at least depositor_min_bond in the pool to start nominating.

Source

pub fn set_state( origin: <T as Config>::RuntimeOrigin, pool_id: u32, state: PoolState, ) -> Result<(), DispatchError>

Set a new state for the pool.

If a pool is already in the Destroying state, then under no condition can its state change again.

The dispatch origin of this call must be either:

  1. signed by the bouncer, or the root role of the pool,
  2. if the pool conditions to be open are NOT met (as described by ok_to_be_open), and then the state of the pool can be permissionlessly changed to Destroying.
Source

pub fn set_metadata( origin: <T as Config>::RuntimeOrigin, pool_id: u32, metadata: Vec<u8>, ) -> Result<(), DispatchError>

Set a new metadata for the pool.

The dispatch origin of this call must be signed by the bouncer, or the root role of the pool.

Source

pub fn set_configs( origin: <T as Config>::RuntimeOrigin, min_join_bond: ConfigOp<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, min_create_bond: ConfigOp<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, max_pools: ConfigOp<u32>, max_members: ConfigOp<u32>, max_members_per_pool: ConfigOp<u32>, global_max_commission: ConfigOp<Perbill>, ) -> Result<(), DispatchError>

Update configurations for the nomination pools. The origin for this call must be Config::AdminOrigin.

§Arguments
Source

pub fn update_roles( origin: <T as Config>::RuntimeOrigin, pool_id: u32, new_root: ConfigOp<<T as Config>::AccountId>, new_nominator: ConfigOp<<T as Config>::AccountId>, new_bouncer: ConfigOp<<T as Config>::AccountId>, ) -> Result<(), DispatchError>

Update the roles of the pool.

The root is the only entity that can change any of the roles, including itself, excluding the depositor, who can never change.

It emits an event, notifying UIs of the role change. This event is quite relevant to most pool members and they should be informed of changes to pool roles.

Source

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

Chill on behalf of the pool.

The dispatch origin of this call can be signed by the pool nominator or the pool root role, same as Pallet::nominate.

This directly forwards the call to an implementation of StakingInterface (e.g., pallet-staking) through Config::StakeAdapter, on behalf of the bonded pool.

Under certain conditions, this call can be dispatched permissionlessly (i.e. by any account).

§Conditions for a permissionless dispatch:
  • When pool depositor has less than MinNominatorBond staked, otherwise pool members are unable to unbond.
§Conditions for permissioned dispatch:
  • The caller is the pool’s nominator or root.
Source

pub fn bond_extra_other( origin: <T as Config>::RuntimeOrigin, member: <<T as Config>::Lookup as StaticLookup>::Source, extra: BondExtra<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, ) -> Result<(), DispatchError>

origin bonds funds from extra for some pool member member into their respective pools.

origin can bond extra funds from free balance or pending rewards when origin == other.

In the case of origin != other, origin can only bond extra pending rewards of other members assuming set_claim_permission for the given member is PermissionlessCompound or PermissionlessAll.

Source

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

Allows a pool member to set a claim permission to allow or disallow permissionless bonding and withdrawing.

§Arguments
  • origin - Member of a pool.
  • permission - The permission to be applied.
Source

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

origin can claim payouts on some pool member other’s behalf.

Pool member other must have a PermissionlessWithdraw or PermissionlessAll claim permission for this call to be successful.

Source

pub fn set_commission( origin: <T as Config>::RuntimeOrigin, pool_id: u32, new_commission: Option<(Perbill, <T as Config>::AccountId)>, ) -> Result<(), DispatchError>

Set the commission of a pool. Both a commission percentage and a commission payee must be provided in the current tuple. Where a current of None is provided, any current commission will be removed.

  • If a None is supplied to new_commission, existing commission will be removed.
Source

pub fn set_commission_max( origin: <T as Config>::RuntimeOrigin, pool_id: u32, max_commission: Perbill, ) -> Result<(), DispatchError>

Set the maximum commission of a pool.

  • Initial max can be set to any Perbill, and only smaller values thereafter.
  • Current commission will be lowered in the event it is higher than a new max commission.
Source

pub fn set_commission_change_rate( origin: <T as Config>::RuntimeOrigin, pool_id: u32, change_rate: CommissionChangeRate<<<T as Config>::BlockNumberProvider as BlockNumberProvider>::BlockNumber>, ) -> Result<(), DispatchError>

Set the commission change rate for a pool.

Initial change rate is not bounded, whereas subsequent updates can only be more restrictive than the current.

Source

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

Claim pending commission.

The root role of the pool is always allowed to claim the pool’s commission.

If the pool has set CommissionClaimPermission::Permissionless, then any account can trigger the process of claiming the pool’s commission.

If the pool has set its CommissionClaimPermission to Account(acc), then only accounts

  • acc, and
  • the pool’s root account

may call this extrinsic on behalf of the pool.

Pending commissions are paid out and added to the total claimed commission. The total pending commission is reset to zero.

Source

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

Top up the deficit or withdraw the excess ED from the pool.

When a pool is created, the pool depositor transfers ED to the reward account of the pool. ED is subject to change and over time, the deposit in the reward account may be insufficient to cover the ED deficit of the pool or vice-versa where there is excess deposit to the pool. This call allows anyone to adjust the ED deposit of the pool by either topping up the deficit or claiming the excess.

Source

pub fn set_commission_claim_permission( origin: <T as Config>::RuntimeOrigin, pool_id: u32, permission: Option<CommissionClaimPermission<<T as Config>::AccountId>>, ) -> Result<(), DispatchError>

Set or remove a pool’s commission claim permission.

Determines who can claim the pool’s pending commission. Only the Root role of the pool is able to configure commission claim permissions.

Source

pub fn apply_slash( origin: <T as Config>::RuntimeOrigin, member_account: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Apply a pending slash on a member.

Fails unless crate::pallet::Config::StakeAdapter is of strategy type: adapter::StakeStrategyType::Delegate.

The pending slash amount of the member must be equal or more than ExistentialDeposit. This call can be dispatched permissionlessly (i.e. by any account). If the execution is successful, fee is refunded and caller may be rewarded with a part of the slash based on the crate::pallet::Config::StakeAdapter configuration.

Source

pub fn migrate_delegation( origin: <T as Config>::RuntimeOrigin, member_account: <<T as Config>::Lookup as StaticLookup>::Source, ) -> Result<PostDispatchInfo, DispatchErrorWithPostInfo<PostDispatchInfo>>

Migrates delegated funds from the pool account to the member_account.

Fails unless crate::pallet::Config::StakeAdapter is of strategy type: adapter::StakeStrategyType::Delegate.

This is a permission-less call and refunds any fee if claim is successful.

If the pool has migrated to delegation based staking, the staked tokens of pool members can be moved and held in their own account. See adapter::DelegateStake

Source

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

Migrate pool from adapter::StakeStrategyType::Transfer to adapter::StakeStrategyType::Delegate.

Fails unless crate::pallet::Config::StakeAdapter is of strategy type: adapter::StakeStrategyType::Delegate.

This call can be dispatched permissionlessly, and refunds any fee if successful.

If the pool has already migrated to delegation based staking, this call will fail.

Source§

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

Source

pub fn depositor_min_bond() -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

The amount of bond that MUST REMAIN IN BONDED in ALL POOLS.

It is the responsibility of the depositor to put these funds into the pool initially. Upon unbond, they can never unbond to a value below this amount.

It is essentially max { MinNominatorBond, MinCreateBond, MinJoinBond }, where the former is coming from the staking pallet and the latter two are configured in this pallet.

Source

pub fn dissolve_pool(bonded_pool: BondedPool<T>)

Remove everything related to the given bonded pool.

Metadata and all of the sub-pools are also deleted. All accounts are dusted and the leftover of the reward account is returned to the depositor.

Source

pub fn generate_bonded_account(id: u32) -> <T as Config>::AccountId

Create the main, bonded account of a pool with the given id.

Source

pub fn generate_reward_account(id: u32) -> <T as Config>::AccountId

Create the reward account of a pool with the given id.

Source

pub fn unfreeze_pool_deposit( reward_acc: &<T as Config>::AccountId, ) -> Result<(), DispatchError>

Removes the ED freeze on the reward account of pool_id.

Source

pub fn do_try_state(level: u8) -> Result<(), DispatchError>

Ensure the correctness of the state of this pallet.

This should be valid before or after each state transition of this pallet.

§Invariants:

First, let’s consider pools:

  • BondedPools and RewardPools must all have the EXACT SAME key-set.
  • SubPoolsStorage must be a subset of the above superset.
  • Metadata keys must be a subset of the above superset.
  • the count of the above set must be less than MaxPools.

Then, considering members as well:

  • each BondedPool.member_counter must be:
    • correct (compared to actual count of member who have .pool_id this pool)
    • less than MaxPoolMembersPerPool.
  • each member.pool_id must correspond to an existing BondedPool.id (which implies the existence of the reward pool as well).
  • count of all members must be less than MaxPoolMembers.
  • each BondedPool.points must never be lower than the pool’s balance.

Then, considering unbonding members:

for each pool:

  • sum of the balance that’s tracked in all unbonding pools must be the same as the unbonded balance of the main account, as reported by the staking interface.
  • sum of the balance that’s tracked in all unbonding pools, plus the bonded balance of the main account should be less than or qual to the total balance of the main account.
§Sanity check level

To cater for tests that want to escape parts of these checks, this function is split into multiple levels, where the higher the level, the more checks we performs. So, try_state(255) is the strongest sanity check, and 0 performs no checks.

Source

pub fn check_ed_imbalance() -> Result<(), DispatchError>

Check if any pool have an incorrect amount of ED frozen.

This can happen if the ED has changed since the pool was created.

Source

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

Fully unbond the shares of member, when executed from origin.

This is useful for backwards compatibility with the majority of tests that only deal with full unbonding, not partial unbonding.

Source§

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

Source

pub fn api_pending_rewards( who: <T as Config>::AccountId, ) -> Option<<<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>

Returns the pending rewards for the specified who account.

In the case of error, None is returned. Used by runtime API.

Source

pub fn api_points_to_balance( pool_id: u32, points: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Returns the points to balance conversion for a specified pool.

If the pool ID does not exist, it returns 0 ratio points to balance. Used by runtime API.

Source

pub fn api_balance_to_points( pool_id: u32, new_funds: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Returns the equivalent new_funds balance to point conversion for a specified pool.

If the pool ID does not exist, returns 0 ratio balance to points. Used by runtime API.

Source

pub fn api_pool_pending_slash( pool_id: u32, ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Returns the unapplied slash of the pool.

Pending slash is only applicable with adapter::DelegateStake strategy.

Source

pub fn api_member_pending_slash( who: <T as Config>::AccountId, ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Returns the unapplied slash of a member.

Pending slash is only applicable with adapter::DelegateStake strategy.

If pending slash of the member exceeds ExistentialDeposit, it can be reported on chain via Call::apply_slash.

Source

pub fn api_pool_needs_delegate_migration(pool_id: u32) -> bool

Checks whether pool needs to be migrated to adapter::StakeStrategyType::Delegate. Only applicable when the Config::StakeAdapter is adapter::DelegateStake.

Useful to check this before calling Call::migrate_pool_to_delegate_stake.

Source

pub fn api_member_needs_delegate_migration( who: <T as Config>::AccountId, ) -> bool

Checks whether member delegation needs to be migrated to adapter::StakeStrategyType::Delegate. Only applicable when the Config::StakeAdapter is adapter::DelegateStake.

Useful to check this before calling Call::migrate_delegation.

Source

pub fn api_member_total_balance( who: <T as Config>::AccountId, ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Contribution of the member in the pool.

Includes balance that is unbonded from staking but not claimed yet from the pool, therefore this balance can be higher than the staked funds.

Source

pub fn api_pool_balance( pool_id: u32, ) -> <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Total balance contributed to the pool.

Source

pub fn api_pool_accounts( pool_id: u32, ) -> (<T as Config>::AccountId, <T as Config>::AccountId)

Returns the bonded account and reward account associated with the pool_id.

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> 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> 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 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 integrity_test()

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

fn on_initialize(_n: BlockNumber) -> Weight

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

fn on_finalize(_n: BlockNumber)

Block finalization hook. This is called at the very end of block execution. 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> 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> OnStakingUpdate<<T as Config>::AccountId, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance> for Pallet<T>
where T: Config,

Source§

fn on_slash( pool_account: &<T as Config>::AccountId, slashed_bonded: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, slashed_unlocking: &BTreeMap<u32, <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance>, total_slashed: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, )

Reduces the balances of the SubPools, that belong to the pool involved in the slash, to the amount that is defined in the slashed_unlocking field of sp_staking::OnStakingUpdate::on_slash

Emits the PoolsSlashed event.

Source§

fn on_withdraw( pool_account: &<T as Config>::AccountId, amount: <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance, )

Reduces the overall TotalValueLocked if a withdrawal happened for a pool involved in the staking withdraw.

Source§

fn on_stake_update(_who: &AccountId, _prev_stake: Option<Stake<Balance>>)

Fired when the stake amount of someone updates. Read more
Source§

fn on_nominator_add(_who: &AccountId)

Fired when someone sets their intention to nominate. Read more
Source§

fn on_nominator_update(_who: &AccountId, _prev_nominations: Vec<AccountId>)

Fired when an existing nominator updates their nominations. Read more
Source§

fn on_nominator_remove(_who: &AccountId, _nominations: Vec<AccountId>)

Fired when someone removes their intention to nominate, either due to chill or validating. Read more
Source§

fn on_validator_add(_who: &AccountId)

Fired when someone sets their intention to validate. Read more
Source§

fn on_validator_update(_who: &AccountId)

Fired when an existing validator updates their preferences. Read more
Source§

fn on_validator_remove(_who: &AccountId)

Fired when someone removes their intention to validate, either due to chill or nominating.
Source§

fn on_unstake(_who: &AccountId)

Fired when someone is fully unstaked.
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> 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>