referrerpolicy=no-referrer-when-downgrade
pallet_assets

Trait BalanceOnHold

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

This trait indicates a balance that is on hold for an asset account.

A balance on hold is a balance that, while is assigned to an account, is outside the direct control of it. Instead, is being held by the system logic (i.e. Pallets) and can be eventually burned or released.

Required Methods§

Source

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

Return the held balance.

If Some, it means some balance is on hold, and it can be infallibly burned.

If None is returned, then no balance is on hold for who’s asset account.

Source

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

Called after an account has been removed.

It is expected that this method is called only when there is no balance on hold. Otherwise, an account should not be removed.

Source

fn contains_holds(asset: AssetId) -> bool

Return a value that indicates if there are registered holds 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> BalanceOnHold<AssetId, AccountId, Balance> for ()

Source§

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

Source§

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

Source§

fn contains_holds(_: AssetId) -> bool

Implementors§

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