Trait pallet_price_aggregator::pallet::Config
source · pub trait Config: Config {
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type MaxValuesPerBlock: Get<u32>;
type ProcessBlockValues: ProcessBlockValues;
type NativeCurrencyId: Get<CurrencyId>;
type CircularBufferLength: Get<u32>;
type AggregationDuration: Get<BlockNumberFor<Self>>;
type WeightInfo: WeightInfo;
}
Expand description
Configuration trait of this pallet.
The main purpose of this trait is to act as an interface between this pallet and the runtime in which it is embedded in. A type, function, or constant in this trait is essentially left to be configured by the runtime that includes this pallet.
Consequently, a runtime that wants to include this pallet must implement this trait.
Required Associated Types§
sourcetype RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
sourcetype MaxValuesPerBlock: Get<u32>
type MaxValuesPerBlock: Get<u32>
Maximum number of distinct currency values we can store during a single block.
sourcetype ProcessBlockValues: ProcessBlockValues
type ProcessBlockValues: ProcessBlockValues
Used to process accumulated values in the current block.
sourcetype NativeCurrencyId: Get<CurrencyId>
type NativeCurrencyId: Get<CurrencyId>
Native currency ID that this pallet is supposed to track.
sourcetype CircularBufferLength: Get<u32>
type CircularBufferLength: Get<u32>
Maximum length of the circular buffer used to calculate the moving average.
sourcetype AggregationDuration: Get<BlockNumberFor<Self>>
type AggregationDuration: Get<BlockNumberFor<Self>>
Duration of aggregation period expressed in the number of blocks. During this time, currency values are aggregated, and are then used to calculate the average value.