referrerpolicy=no-referrer-when-downgrade

Trait polkadot_runtime_parachains::FeeTracker

source ·
pub trait FeeTracker {
    type Id;

    // Required methods
    fn get_fee_factor(id: Self::Id) -> FixedU128;
    fn increase_fee_factor(
        id: Self::Id,
        message_size_factor: FixedU128,
    ) -> FixedU128;
    fn decrease_fee_factor(id: Self::Id) -> FixedU128;
}
Expand description

Trait for tracking message delivery fees on a transport protocol.

Required Associated Types§

source

type Id

Type used for assigning different fee factors to different destinations

Required Methods§

source

fn get_fee_factor(id: Self::Id) -> FixedU128

Returns the evolving exponential fee factor which will be used to calculate the delivery fees.

source

fn increase_fee_factor( id: Self::Id, message_size_factor: FixedU128, ) -> FixedU128

Increases the delivery fee factor by a factor based on message size and records the result.

Returns the new delivery fee factor after the increase.

source

fn decrease_fee_factor(id: Self::Id) -> FixedU128

Decreases the delivery fee factor by a constant factor and records the result.

Does not reduce the fee factor below the initial value, which is currently set as 1.

Returns the new delivery fee factor after the decrease.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T: Config> FeeTracker for Pallet<T>

§

type Id = Id