referrerpolicy=no-referrer-when-downgrade
pallet_nomination_pools::adapter

Struct TransferStake

Source
pub struct TransferStake<T: Config, Staking: StakingInterface>(/* private fields */);
๐Ÿ‘ŽDeprecated: consider migrating to DelegateStake
Expand description

A staking strategy implementation that supports transfer based staking.

In order to stake, this adapter transfers the funds from the member/delegator account to the pool account and stakes through the pool account on Staking.

This is the older Staking strategy used by pools. To switch to the newer DelegateStake strategy in an existing runtime, storage migration is required. See migration::unversioned::DelegationStakeMigration. For new runtimes, it is highly recommended to use the DelegateStake strategy.

Trait Implementationsยง

Sourceยง

impl<T: Config, Staking: StakingInterface<Balance = BalanceOf<T>, AccountId = T::AccountId>> StakeStrategy for TransferStake<T, Staking>

Sourceยง

type Balance = <<T as Config>::Currency as Inspect<<T as Config>::AccountId>>::Balance

Sourceยง

type AccountId = <T as Config>::AccountId

Sourceยง

type CoreStaking = Staking

Sourceยง

fn strategy_type() -> StakeStrategyType

The type of staking strategy of the current adapter.
Sourceยง

fn transferable_balance( pool_account: Pool<Self::AccountId>, _: Member<Self::AccountId>, ) -> BalanceOf<T>

Balance that can be transferred from pool account to member. Read more
Sourceยง

fn total_balance(pool_account: Pool<Self::AccountId>) -> Option<BalanceOf<T>>

Total balance of the pool including amount that is actively staked.
Sourceยง

fn member_delegation_balance( _member_account: Member<T::AccountId>, ) -> Option<Staking::Balance>

Amount of tokens delegated by the member.
Sourceยง

fn pledge_bond( who: Member<T::AccountId>, pool_account: Pool<Self::AccountId>, reward_account: &Self::AccountId, amount: BalanceOf<T>, bond_type: BondType, ) -> DispatchResult

Pledge amount towards pool_account and update the pool bond. Also see [StakingInterface::bond].
Sourceยง

fn member_withdraw( who: Member<Self::AccountId>, pool_account: Pool<Self::AccountId>, amount: BalanceOf<T>, _num_slashing_spans: u32, ) -> DispatchResult

Withdraw funds from pool account to member account.
Sourceยง

fn dissolve(pool_account: Pool<Self::AccountId>) -> DispatchResult

Dissolve the pool account.
Sourceยง

fn pending_slash(_: Pool<Self::AccountId>) -> Self::Balance

Check if there is any pending slash for the pool.
Sourceยง

fn member_slash( _who: Member<Self::AccountId>, _pool: Pool<Self::AccountId>, _amount: Staking::Balance, _maybe_reporter: Option<T::AccountId>, ) -> DispatchResult

Slash the member account with amount against pending slashes for the pool.
Sourceยง

fn migrate_nominator_to_agent( _pool: Pool<Self::AccountId>, _reward_account: &Self::AccountId, ) -> DispatchResult

Migrate pool account from being a direct nominator to a delegated agent. Read more
Sourceยง

fn migrate_delegation( _pool: Pool<Self::AccountId>, _delegator: Member<Self::AccountId>, _value: Self::Balance, ) -> DispatchResult

Migrate member balance from pool account to member account. Read more
Sourceยง

fn bonding_duration() -> EraIndex

See [StakingInterface::bonding_duration].
Sourceยง

fn current_era() -> EraIndex

See [StakingInterface::current_era].
Sourceยง

fn minimum_nominator_bond() -> Self::Balance

See [StakingInterface::minimum_nominator_bond].
Sourceยง

fn active_stake(pool_account: Pool<Self::AccountId>) -> Self::Balance

See [StakingInterface::active_stake].
Sourceยง

fn total_stake(pool_account: Pool<Self::AccountId>) -> Self::Balance

See [StakingInterface::total_stake].
Sourceยง

fn pool_strategy(pool_account: Pool<Self::AccountId>) -> StakeStrategyType

Which strategy the pool account is using. Read more
Sourceยง

fn nominate( pool_account: Pool<Self::AccountId>, validators: Vec<Self::AccountId>, ) -> DispatchResult

See [StakingInterface::nominate].
Sourceยง

fn chill(pool_account: Pool<Self::AccountId>) -> DispatchResult

See [StakingInterface::chill].
Sourceยง

fn unbond( pool_account: Pool<Self::AccountId>, amount: Self::Balance, ) -> DispatchResult

See [StakingInterface::unbond].
Sourceยง

fn withdraw_unbonded( pool_account: Pool<Self::AccountId>, num_slashing_spans: u32, ) -> Result<bool, DispatchError>

See [StakingInterface::withdraw_unbonded].
Sourceยง

fn nominations( pool_account: Pool<Self::AccountId>, ) -> Option<Vec<Self::AccountId>>

List of validators nominated by the pool account.
Sourceยง

fn remove_as_agent(_pool: Pool<Self::AccountId>)

Remove the pool account as agent. Read more

Auto Trait Implementationsยง

ยง

impl<T, Staking> Freeze for TransferStake<T, Staking>
where <T as Config>::RuntimeEvent: Sized,

ยง

impl<T, Staking> RefUnwindSafe for TransferStake<T, Staking>
where <T as Config>::RuntimeEvent: Sized, T: RefUnwindSafe, Staking: RefUnwindSafe,

ยง

impl<T, Staking> Send for TransferStake<T, Staking>
where <T as Config>::RuntimeEvent: Sized, T: Send, Staking: Send,

ยง

impl<T, Staking> Sync for TransferStake<T, Staking>
where <T as Config>::RuntimeEvent: Sized, T: Sync, Staking: Sync,

ยง

impl<T, Staking> Unpin for TransferStake<T, Staking>
where <T as Config>::RuntimeEvent: Sized, T: Unpin, Staking: Unpin,

ยง

impl<T, Staking> UnwindSafe for TransferStake<T, Staking>
where <T as Config>::RuntimeEvent: Sized, T: UnwindSafe, Staking: UnwindSafe,

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
ยง

impl<T> CheckedConversion for T

ยง

fn checked_from<T>(t: T) -> Option<Self>
where Self: TryFrom<T>,

Convert from a value of T into an equivalent instance of Option<Self>. Read more
ยง

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
ยง

impl<T> Conv for T

ยง

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
ยง

impl<T> FmtForward for T

ยง

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
ยง

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
ยง

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
ยง

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
ยง

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
ยง

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
ยง

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
ยง

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
ยง

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

ยง

impl<T> Instrument for T

ยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
ยง

impl<T, U> IntoKey<U> for T
where U: FromKey<T>,

ยง

fn into_key(self) -> U

ยง

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

ยง

fn into_tuple(self) -> Dest

ยง

impl<T> IsType<T> for T

ยง

fn from_ref(t: &T) -> &T

Cast reference.
ยง

fn into_ref(&self) -> &T

Cast reference.
ยง

fn from_mut(t: &mut T) -> &mut T

Cast mutable reference.
ยง

fn into_mut(&mut self) -> &mut T

Cast mutable reference.
ยง

impl<T, Outer> IsWrappedBy<Outer> for T
where Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,

ยง

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

ยง

fn from_mut(outer: &mut Outer) -> &mut T

Get a mutable reference to the inner from the outer.

ยง

impl<T> Pipe for T
where T: ?Sized,

ยง

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
ยง

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
ยง

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
ยง

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
ยง

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
ยง

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
ยง

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
ยง

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
ยง

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
ยง

impl<T> Pointable for T

ยง

const ALIGN: usize = _

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
ยง

impl<T> SaturatedConversion for T

ยง

fn saturated_from<T>(t: T) -> Self
where Self: UniqueSaturatedFrom<T>,

Convert from a value of T into an equivalent instance of Self. Read more
ยง

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
ยง

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

ยง

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
ยง

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
ยง

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
ยง

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
ยง

impl<T> Tap for T

ยง

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
ยง

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
ยง

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
ยง

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
ยง

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
ยง

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
ยง

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
ยง

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
ยง

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
ยง

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
ยง

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
ยง

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
ยง

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
ยง

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
ยง

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
ยง

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
ยง

impl<T> TryConv for T

ยง

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
ยง

impl<T, U> TryIntoKey<U> for T
where U: TryFromKey<T>,

ยง

type Error = <U as TryFromKey<T>>::Error

ยง

fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>

ยง

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

ยง

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
ยง

impl<T, S> UniqueSaturatedInto<T> for S
where T: Bounded, S: TryInto<T>,

ยง

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
ยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

ยง

fn vzip(self) -> V

ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

impl<T> ErasedDestructor for T
where T: 'static,

ยง

impl<T> JsonSchemaMaybe for T

ยง

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

ยง

impl<T> MaybeSendSync for T