referrerpolicy=no-referrer-when-downgrade
polkadot_sdk_frame::token::fungibles::hold

Trait Balanced

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,
    ) -> (Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, Self::Balance) { ... }
}
Expand description

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

Provided Methods§

fn slash( asset: Self::AssetId, reason: &Self::Reason, who: &AccountId, amount: Self::Balance, ) -> (Imbalance<Self::AssetId, Self::Balance, Self::OnDropCredit, Self::OnDropDebt>, 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.

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.

Implementors§

§

impl<Left, Right, Criterion, AssetKind, AccountId> Balanced<AccountId> for polkadot_sdk_frame::token::fungible::UnionOf<Left, Right, Criterion, AssetKind, AccountId>
where Left: Balanced<AccountId> + DoneSlash<<UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::Reason, AccountId, <UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::Balance>, Right: Balanced<AccountId, Balance = <Left as Inspect<AccountId>>::Balance, Reason = <Left as Inspect<AccountId>>::Reason> + DoneSlash<AssetKind, <Left as Inspect<AccountId>>::Reason, AccountId, <Left as Inspect<AccountId>>::Balance>, Criterion: Convert<AssetKind, Either<(), <Right as Inspect<AccountId>>::AssetId>>, AssetKind: AssetId,

§

impl<Left, Right, Criterion, AssetKind, AccountId> Balanced<AccountId> for polkadot_sdk_frame::token::fungibles::UnionOf<Left, Right, Criterion, AssetKind, AccountId>
where Left: Balanced<AccountId> + DoneSlash<<UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::AssetId, <UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::Reason, AccountId, <UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::Balance>, Right: Balanced<AccountId, Balance = <Left as Inspect<AccountId>>::Balance, Reason = <Left as Inspect<AccountId>>::Reason> + DoneSlash<<UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::AssetId, <UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::Reason, AccountId, <UnionOf<Left, Right, Criterion, AssetKind, AccountId> as Inspect<AccountId>>::Balance>, Criterion: Convert<AssetKind, Either<<Left as Inspect<AccountId>>::AssetId, <Right as Inspect<AccountId>>::AssetId>>, AssetKind: AssetId,