Trait frame_support::traits::tokens::fungible::hold::Balanced

source ·
pub trait Balanced<AccountId>: Balanced<AccountId> + Unbalanced<AccountId> {
    // Provided methods
    fn slash(
        reason: &Self::Reason,
        who: &AccountId,
        amount: Self::Balance,
    ) -> (Credit<AccountId, Self>, Self::Balance) { ... }
    fn done_slash(
        _reason: &Self::Reason,
        _who: &AccountId,
        _amount: Self::Balance,
    ) { ... }
}
Expand description

Trait for slashing a fungible asset which can be place on hold.

Provided Methods§

source

fn slash( reason: &Self::Reason, who: &AccountId, amount: Self::Balance, ) -> (Credit<AccountId, Self>, Self::Balance)

Reduce the balance of some funds on hold in an account.

The resulting imbalance is the first item of the tuple returned.

As much funds that are on hold up to amount will be deducted as possible. If this is less than amount, then a non-zero second item will be returned.

source

fn done_slash(_reason: &Self::Reason, _who: &AccountId, _amount: Self::Balance)

Object Safety§

This trait is not object safe.

Implementors§

source§

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