referrerpolicy=no-referrer-when-downgrade

Trait polkadot_sdk_frame::traits::tokens::fungible::freeze::Inspect

pub trait Inspect<AccountId>: Inspect<AccountId> {
    type Id: Encode + TypeInfo + 'static;

    // Required methods
    fn balance_frozen(id: &Self::Id, who: &AccountId) -> Self::Balance;
    fn can_freeze(id: &Self::Id, who: &AccountId) -> bool;

    // Provided method
    fn balance_freezable(who: &AccountId) -> Self::Balance { ... }
}
Expand description

Trait for inspecting a fungible asset which can be frozen. Freezing is essentially setting a minimum balance bellow which the total balance (inclusive of any funds placed on hold) may not be normally allowed to drop. Generally, freezers will provide an “update” function such that if the total balance does drop below the limit, then the freezer can update their housekeeping accordingly.

Required Associated Types§

type Id: Encode + TypeInfo + 'static

An identifier for a freeze.

Required Methods§

fn balance_frozen(id: &Self::Id, who: &AccountId) -> Self::Balance

Amount of funds frozen in reserve by who for the given id.

fn can_freeze(id: &Self::Id, who: &AccountId) -> bool

Returns true if it’s possible to introduce a freeze for the given id onto the account of who. This will be true as long as the implementor supports as many concurrent freezes as there are possible values of id.

Provided Methods§

fn balance_freezable(who: &AccountId) -> Self::Balance

The amount of the balance which can become frozen. Defaults to total_balance().

Object Safety§

This trait is not object safe.

Implementors§

§

impl<F, A, AccountId> Inspect<AccountId> for ItemOf<F, A, AccountId>
where F: Inspect<AccountId>, A: Get<<F as Inspect<AccountId>>::AssetId>,

§

type Id = <F as Inspect<AccountId>>::Id