Trait orml_traits::currency::BasicCurrencyExtended

source ·
pub trait BasicCurrencyExtended<AccountId>: BasicCurrency<AccountId> {
    type Amount: Signed + TryInto<Self::Balance> + TryFrom<Self::Balance> + SimpleArithmetic + Codec + Copy + MaybeSerializeDeserialize + Debug + Default + MaxEncodedLen;

    // Required method
    fn update_balance(
        who: &AccountId,
        by_amount: Self::Amount
    ) -> DispatchResult;
}
Expand description

Extended BasicCurrency with additional helper types and methods.

Required Associated Types§

source

type Amount: Signed + TryInto<Self::Balance> + TryFrom<Self::Balance> + SimpleArithmetic + Codec + Copy + MaybeSerializeDeserialize + Debug + Default + MaxEncodedLen

The signed type for balance related operations, typically signed int.

Required Methods§

source

fn update_balance(who: &AccountId, by_amount: Self::Amount) -> DispatchResult

Add or remove abs(by_amount) from the balance of who. If positive by_amount, do add, else do remove.

Object Safety§

This trait is not object safe.

Implementors§