referrerpolicy=no-referrer-when-downgrade

Trait frame_support::traits::tokens::fungible::freeze::Inspect

source ·
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§

source

type Id: Encode + TypeInfo + 'static

An identifier for a freeze.

Required Methods§

source

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

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

source

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§

source

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§

source§

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

§

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