referrerpolicy=no-referrer-when-downgrade

Trait frame_support::traits::tokens::fungibles::hold::Balanced

source ·
pub trait Balanced<AccountId>: Balanced<AccountId> + Unbalanced<AccountId> + DoneSlash<Self::AssetId, Self::Reason, AccountId, Self::Balance> {
    // Provided method
    fn slash(
        asset: Self::AssetId,
        reason: &Self::Reason,
        who: &AccountId,
        amount: Self::Balance,
    ) -> (Credit<AccountId, Self>, Self::Balance) { ... }
}
Expand description

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

Provided Methods§

source

fn slash( asset: Self::AssetId, 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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Left: BalancedHold<AccountId> + DoneSlash<Self::Reason, AccountId, Self::Balance>, Right: BalancedHold<AccountId, Balance = Left::Balance, Reason = Left::Reason> + DoneSlash<AssetKind, Left::Reason, AccountId, Left::Balance>, Criterion: Convert<AssetKind, Either<(), Right::AssetId>>, AssetKind: AssetId, AccountId> Balanced<AccountId> for frame_support::traits::tokens::fungible::UnionOf<Left, Right, Criterion, AssetKind, AccountId>

source§

impl<Left: BalancedHold<AccountId> + DoneSlash<Self::AssetId, Self::Reason, AccountId, Self::Balance>, Right: BalancedHold<AccountId, Balance = Left::Balance, Reason = Left::Reason> + DoneSlash<Self::AssetId, Self::Reason, AccountId, Self::Balance>, Criterion: Convert<AssetKind, Either<Left::AssetId, Right::AssetId>>, AssetKind: AssetId, AccountId> Balanced<AccountId> for frame_support::traits::tokens::fungibles::UnionOf<Left, Right, Criterion, AssetKind, AccountId>