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

Commit

Permalink
improve doc (#10431)
Browse files Browse the repository at this point in the history
  • Loading branch information
thiolliere committed Dec 9, 2021
1 parent b45359a commit 7926c6d
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions frame/assets/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,20 +122,25 @@ pub struct DestroyWitness {
/// `minimum_balance` of the asset. This is additive - the `minimum_balance` of the asset must be
/// met *and then* anything here in addition.
pub trait FrozenBalance<AssetId, AccountId, Balance> {
/// Return the frozen balance. Under normal behaviour, this amount should always be
/// withdrawable.
/// Return the frozen balance.
///
/// In reality, the balance of every account must be at least the sum of this (if `Some`) and
/// the asset's minimum_balance, since there may be complications to destroying an asset's
/// account completely.
/// Under normal behaviour, the account balance should not go below the sum of this (if `Some`)
/// and the asset's minimum balance.
/// But the account balance can be below this sum (e.g. if less than the sum has been
/// transfered to the account).
///
/// If `None` is returned, then nothing special is enforced.
/// In special case (privileged intervention) the account balance can go below the sum.
///
/// If any operation ever breaks this requirement (which will only happen through some sort of
/// privileged intervention), then `melted` is called to do any cleanup.
/// If `None` is returned, then nothing special is enforced.
fn frozen_balance(asset: AssetId, who: &AccountId) -> Option<Balance>;

/// Called when an account has been removed.
///
/// # Warning
///
/// This function must never access storage of pallet asset. This function is called while some
/// change are pending. Calling into the pallet asset in this function can result in unexpected
/// state.
fn died(asset: AssetId, who: &AccountId);
}

Expand Down

0 comments on commit 7926c6d

Please sign in to comment.