referrerpolicy=no-referrer-when-downgrade
pallet_assets

Trait FrozenBalance

Source
pub trait FrozenBalance<AssetId, AccountId, Balance> {
    // Required methods
    fn frozen_balance(asset: AssetId, who: &AccountId) -> Option<Balance>;
    fn died(asset: AssetId, who: &AccountId);
    fn contains_freezes(asset: AssetId) -> bool;
}
Expand description

Trait for allowing a minimum balance on the account to be specified, beyond the minimum_balance of the asset. This is additive - the minimum_balance of the asset must be met and then anything here in addition.

Required Methods§

Source

fn frozen_balance(asset: AssetId, who: &AccountId) -> Option<Balance>

Return the frozen balance.

Generally, the balance of every account must be at least the sum of this (if Some) and the asset’s minimum_balance (the latter 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. However, the account balance may reasonably begin below this sum (e.g. if less than the sum had ever been transferred into the account).

In special cases (privileged intervention) the account balance may also go below the sum.

If None is returned, then nothing special is enforced.

Source

fn died(asset: AssetId, who: &AccountId)

Called after an account has been removed.

Source

fn contains_freezes(asset: AssetId) -> bool

Return a value that indicates if there are registered freezes for a given asset.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<AssetId, AccountId, Balance> FrozenBalance<AssetId, AccountId, Balance> for ()

Source§

fn frozen_balance(_: AssetId, _: &AccountId) -> Option<Balance>

Source§

fn died(_: AssetId, _: &AccountId)

Source§

fn contains_freezes(_: AssetId) -> bool

Implementors§

impl<T: Config<I>, I: 'static> FrozenBalance<<T as Config<I>>::AssetId, <T as Config>::AccountId, <T as Config<I>>::Balance> for Pallet<T, I>