Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Bonded fund cannot be used for transaction payment but comments said otherwise #4616

@xlc

Description

@xlc

Previously, bonded fund can be used for transaction payment so it is OK to bond all the funds and still be able to make transaction to unbond them. This is no longer possible after #3606 but the comments still says The lock will lock the entire funds except paying for further transactions.

/// Update the ledger for a controller. This will also update the stash lock. The lock will
/// will lock the entire funds except paying for further transactions.
fn update_ledger(
controller: &T::AccountId,
ledger: &StakingLedger<T::AccountId, BalanceOf<T>>
) {
T::Currency::set_lock(
STAKING_ID,
&ledger.stash,
ledger.total,
T::BlockNumber::max_value(),
WithdrawReasons::all(),
);
<Ledger<T>>::insert(controller, ledger);
}

With WithdrawReason::Tip, it should be safe to allow TransactionPayment reason and #3364 (comment) no longer applies.

Metadata

Metadata

Assignees

Labels

I6-documentationDocumentation needs fixing, improving or augmenting.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions