pub trait Config<I: 'static = ()>: Config {
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>;
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + From<Call<Self>> + IsSubType<Call<Self, I>> + IsType<<Self as Config>::RuntimeCall>;
type ReserveReason: RuntimeEnum + Delimited + Copy + VariantCount;
type LockReason: RuntimeEnum + Delimited + Copy + VariantCount;
type Xp: Asset + From<Self::Pulse>;
type Pulse: Time;
type WeightInfo: WeightInfo;
type Extensions: XpSystemExtensions<Via = Pallet<Self, I>> + XpOwnerListener + XpMutateListener + XpReserveListener + XpLockListener + XpReapListener;
type EmitEvents: Get<bool> + Clone + Debug;
}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. Configuration trait for the XP pallet.
This trait defines the types, constants, and dependencies that the runtime must provide for this pallet to function.
The generic parameter I allows the same pallet to be instantiated
multiple times within a runtime. Each instance can have its own
independent storage and configuration.
Example:
I = ()-> default (single instance)I = Core,Instance2, etc. -> multiple independent instances
Required Associated Types§
Sourcetype RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
type RuntimeEvent: From<Event<Self, I>> + IsType<<Self as Config>::RuntimeEvent>
The overarching event type.
Sourcetype RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + From<Call<Self>> + IsSubType<Call<Self, I>> + IsType<<Self as Config>::RuntimeCall>
type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin> + GetDispatchInfo + From<Call<Self>> + IsSubType<Call<Self, I>> + IsType<<Self as Config>::RuntimeCall>
The overarching call type.
Sourcetype ReserveReason: RuntimeEnum + Delimited + Copy + VariantCount
type ReserveReason: RuntimeEnum + Delimited + Copy + VariantCount
The reason type for XP reserves.
This should be a bounded, enumerable type (e.g., an enum) that classifies the context or intent for which XP is reserved (such as staking, governance, or slashing).
Sourcetype LockReason: RuntimeEnum + Delimited + Copy + VariantCount
type LockReason: RuntimeEnum + Delimited + Copy + VariantCount
The reason type for XP locks.
This should be a bounded, enumerable type (e.g., an enum) that classifies the context or intent for which XP is locked (such as staking, governance, or slashing).
Sourcetype Pulse: Time
type Pulse: Time
The numeric type used for pulse calculations (XP activity heartbeat i.e., reputation).
Sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
Sourcetype Extensions: XpSystemExtensions<Via = Pallet<Self, I>> + XpOwnerListener + XpMutateListener + XpReserveListener + XpLockListener + XpReapListener
type Extensions: XpSystemExtensions<Via = Pallet<Self, I>> + XpOwnerListener + XpMutateListener + XpReserveListener + XpLockListener + XpReapListener
XP extensions for external integrations.
This defines extension hooks that observe XP lifecycle events.
Note:
- Not intended for consensus-critical logic.
- Use
frame_suite::Ignorefor a no-op implementation. - Invoked regardless of
Self::EmitEvents.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.