Trait cfg_traits::fees::Fees

source ·
pub trait Fees {
    type AccountId;
    type Balance: Balance;
    type FeeKey;

    // Required methods
    fn fee_value(key: Self::FeeKey) -> Self::Balance;
    fn fee_to_author(
        from: &Self::AccountId,
        fee: Fee<Self::Balance, Self::FeeKey>
    ) -> DispatchResult;
    fn fee_to_burn(
        from: &Self::AccountId,
        fee: Fee<Self::Balance, Self::FeeKey>
    ) -> DispatchResult;
    fn fee_to_treasury(
        from: &Self::AccountId,
        fee: Fee<Self::Balance, Self::FeeKey>
    ) -> DispatchResult;
}
Expand description

A trait that used to deal with fees

Required Associated Types§

Required Methods§

source

fn fee_value(key: Self::FeeKey) -> Self::Balance

Get the fee balance for a fee key

source

fn fee_to_author( from: &Self::AccountId, fee: Fee<Self::Balance, Self::FeeKey> ) -> DispatchResult

Pay an amount of fee to the block author If the from account has not enough balance or the author is invalid the fees are not paid.

source

fn fee_to_burn( from: &Self::AccountId, fee: Fee<Self::Balance, Self::FeeKey> ) -> DispatchResult

Burn an amount of fee If the from account has not enough balance the fees are not paid.

source

fn fee_to_treasury( from: &Self::AccountId, fee: Fee<Self::Balance, Self::FeeKey> ) -> DispatchResult

Send an amount of fee to the treasury If the from account has not enough balance the fees are not paid.

Object Safety§

This trait is not object safe.

Implementors§