[][src]Trait eq_primitives::FeeManager

pub trait FeeManager<AccountId, Balance> {
    fn calc_fee(
        owner: &AccountId,
        last_update: &u64
    ) -> Result<Balance, InterestRateError>;
fn charge_fee_inner(owner: &AccountId, debt: &Balance); fn charge_fee(
        owner: &AccountId,
        last_update: &u64
    ) -> Result<Balance, InterestRateError> { ... } }

Generic interface for calculating and charging fees. Used in Treasury and Bailsman pallets

Required methods

fn calc_fee(
    owner: &AccountId,
    last_update: &u64
) -> Result<Balance, InterestRateError>

Calculates fee that must be charged from account owner due last_update timestamp

fn charge_fee_inner(owner: &AccountId, debt: &Balance)

Withdraws fee from owner account. Amount that should be withdrawn is passed as debt

Loading content...

Provided methods

fn charge_fee(
    owner: &AccountId,
    last_update: &u64
) -> Result<Balance, InterestRateError>

Calculates and withdraws fee due last_update timestamp from owner. Calls calc_fee and charge_fee_inner. Withdrawn amount is returned in Result

Loading content...

Implementations on Foreign Types

impl<AccountId, Balance: AtLeast32Bit + Clone> FeeManager<AccountId, Balance> for ()[src]

impl<AccountId, Balance: AtLeast32Bit + Clone, TupleElement0: FeeManager<AccountId, Balance>> FeeManager<AccountId, Balance> for (TupleElement0,)[src]

impl<AccountId, Balance: AtLeast32Bit + Clone, TupleElement0: FeeManager<AccountId, Balance>, TupleElement1: FeeManager<AccountId, Balance>> FeeManager<AccountId, Balance> for (TupleElement0, TupleElement1)[src]

impl<AccountId, Balance: AtLeast32Bit + Clone, TupleElement0: FeeManager<AccountId, Balance>, TupleElement1: FeeManager<AccountId, Balance>, TupleElement2: FeeManager<AccountId, Balance>> FeeManager<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2)[src]

impl<AccountId, Balance: AtLeast32Bit + Clone, TupleElement0: FeeManager<AccountId, Balance>, TupleElement1: FeeManager<AccountId, Balance>, TupleElement2: FeeManager<AccountId, Balance>, TupleElement3: FeeManager<AccountId, Balance>> FeeManager<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3)[src]

impl<AccountId, Balance: AtLeast32Bit + Clone, TupleElement0: FeeManager<AccountId, Balance>, TupleElement1: FeeManager<AccountId, Balance>, TupleElement2: FeeManager<AccountId, Balance>, TupleElement3: FeeManager<AccountId, Balance>, TupleElement4: FeeManager<AccountId, Balance>> FeeManager<AccountId, Balance> for (TupleElement0, TupleElement1, TupleElement2, TupleElement3, TupleElement4)[src]

Loading content...

Implementors

Loading content...