pub trait Config: Config {
Show 14 associated items
type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
type AssetFreeze: From<FreezeReason> + RuntimeEnum + Delimited + Copy + VariantCount;
type Influence: Balance + From<AuthorAsset<Self>>;
type Asset: Inspect<Author<Self>, Balance = <Self::CommitmentAdapter as InspectAsset<Author<Self>>>::Asset> + Mutate<Author<Self>> + UnbalancedHold<Author<Self>>;
type CommitmentAdapter: Commitment<Author<Self>, Reason = Self::AssetFreeze, DigestSource = Author<Self>, Digest: Ord> + CommitIndex<Author<Self>> + CommitPool<Author<Self>> + InspectAsset<Author<Self>>;
type ActivityProvider: RoleActivity<Author<Self>, BlockNumberFor<Self>>;
type InfluenceModel: PurePluginModel<AuthorAsset<Self>, <Self::InfluenceContext as ModelContext>::Context, Self::Influence> + Default;
type InfluenceContext: ModelContext;
type FlatElectionModel: PurePluginModel<ElectViaInfluence<Self>, <Self::FlatElectionContext as ModelContext>::Context, ElectedAuthors<Self>> + Default;
type FlatElectionContext: ModelContext;
type FairElectionModel: PurePluginModel<ElectViaBacking<Self>, <Self::FairElectionContext as ModelContext>::Context, ElectedAuthors<Self>> + Default;
type FairElectionContext: ModelContext;
type WeightInfo: WeightInfo;
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 Authors pallet.
This trait defines the types, constants, and dependencies that the runtime must provide for this pallet to function.
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 for this pallet.
Allows the Authors pallet to emit events into the runtime event system, e.g., when authors are rewarded, penalized, or change status.
Sourcetype AssetFreeze: From<FreezeReason> + RuntimeEnum + Delimited + Copy + VariantCount
type AssetFreeze: From<FreezeReason> + RuntimeEnum + Delimited + Copy + VariantCount
Type representing reason for freezing assets.
Converts from the pallet-level FreezeReason enum and is used by
the CommitmentAdapter to distinguish between different frozen asset categories.
Sourcetype Influence: Balance + From<AuthorAsset<Self>>
type Influence: Balance + From<AuthorAsset<Self>>
Represents the computed influence of an entity (author, account, etc.).
Influence is derived from a raw backing asset (stake, tokens, or other measure) and is used as the primary metric for calculating an author’s influence over others.
Must implement a unsigned numeric type and support conversion from the raw fungible asset.
Sourcetype Asset: Inspect<Author<Self>, Balance = <Self::CommitmentAdapter as InspectAsset<Author<Self>>>::Asset> + Mutate<Author<Self>> + UnbalancedHold<Author<Self>>
type Asset: Inspect<Author<Self>, Balance = <Self::CommitmentAdapter as InspectAsset<Author<Self>>>::Asset> + Mutate<Author<Self>> + UnbalancedHold<Author<Self>>
The asset type used for distributing rewards and penalties.
This represents a fungible unit (e.g., a token balance) over which the pallet performs reward, penalty, and funding operations.
§Requirements
- Must implement [
Inspect], enabling the pallet to query and verify account balances or holdings of authors.
§Example
type Asset = pallet_balances::Pallet<T>;Sourcetype CommitmentAdapter: Commitment<Author<Self>, Reason = Self::AssetFreeze, DigestSource = Author<Self>, Digest: Ord> + CommitIndex<Author<Self>> + CommitPool<Author<Self>> + InspectAsset<Author<Self>>
type CommitmentAdapter: Commitment<Author<Self>, Reason = Self::AssetFreeze, DigestSource = Author<Self>, Digest: Ord> + CommitIndex<Author<Self>> + CommitPool<Author<Self>> + InspectAsset<Author<Self>>
Commitment trait adapter for managing authors’ external fundings, assets and digests.
This type implements multiple traits:
Commitmentto track asset commitments per author.CommitIndexfor index-based funders.CommitPoolfor pool-backed funding.InspectAssetto query asset balances or holds.
Provides the core mechanism for holding and tracking author funds.
Sourcetype ActivityProvider: RoleActivity<Author<Self>, BlockNumberFor<Self>>
type ActivityProvider: RoleActivity<Author<Self>, BlockNumberFor<Self>>
Activity provider for authors, defining hooks or queries related to an author’s participation and behavior within the runtime.
This type allows the Authors pallet to expose author activity to other pallets that rely on author role participation.
In essence, it provides a standardized, pluggable interface for cross-pallet activity tracking.
Sourcetype InfluenceModel: PurePluginModel<AuthorAsset<Self>, <Self::InfluenceContext as ModelContext>::Context, Self::Influence> + Default
type InfluenceModel: PurePluginModel<AuthorAsset<Self>, <Self::InfluenceContext as ModelContext>::Context, Self::Influence> + Default
Influence computation plugin model.
Influence is a derived, comparable value used in influence-based systems such as elections, ranking, scoring, or governance decisions.
Encapsulates the logic that transforms a raw asset value into an influence metric.
Conceptually performs:
AuthorAsset -> Influence
The specific transformation semantics are entirely defined by the selected model.
Designed to be selectable using template plugin models in
frame_plugins::influence or custom model defining
macros via frame_suite::plugins.
Sourcetype InfluenceContext: ModelContext
type InfluenceContext: ModelContext
Plugin model context for influence computation.
Supplies parameters that configure how the Self::InfluenceModel
behaves at runtime.
This context enables dynamic tuning of influence policies via governance or configuration, without modifying the model implementation or pallet logic.
Must match the context type expected by the selected
Self::InfluenceModel.
Sourcetype FlatElectionModel: PurePluginModel<ElectViaInfluence<Self>, <Self::FlatElectionContext as ModelContext>::Context, ElectedAuthors<Self>> + Default
type FlatElectionModel: PurePluginModel<ElectViaInfluence<Self>, <Self::FlatElectionContext as ModelContext>::Context, ElectedAuthors<Self>> + Default
Flat election plugin model.
Encapsulates the election logic that operates on influence values to determine the final set of elected candidates.
Conceptually performs:
[(Author, Influence)] -> [Author]
The model is expected to return elected candidates in priority
order, as the runtime may truncate the result using
MaxElected or ForceMaxElected.
Designed to be selectable using template plugin models in
frame_plugins::elections::flat or custom model defining
macros via frame_suite::plugins.
Sourcetype FlatElectionContext: ModelContext
type FlatElectionContext: ModelContext
Plugin model context for flat election computation.
Supplies parameters that configure how the
Self::FlatElectionModel behaves at runtime.
Enables dynamic tuning of election policies without modifying the model implementation or pallet logic.
Must match the context type expected by the selected
Self::FlatElectionModel.
Sourcetype FairElectionModel: PurePluginModel<ElectViaBacking<Self>, <Self::FairElectionContext as ModelContext>::Context, ElectedAuthors<Self>> + Default
type FairElectionModel: PurePluginModel<ElectViaBacking<Self>, <Self::FairElectionContext as ModelContext>::Context, ElectedAuthors<Self>> + Default
Fair election plugin model.
Encapsulates the election logic that operates on individual backing contributions to determine the final set of elected candidates.
Conceptually performs:
[(Author, [(Backer, Weight)])] -> [Author]
The model is expected to return elected candidates in priority
order, as the runtime may truncate the result using
MaxElected or ForceMaxElected.
Designed to be selectable using template plugin models in
frame_plugins::elections::fair or custom model defining
macros via frame_suite::plugins.
Sourcetype FairElectionContext: ModelContext
type FairElectionContext: ModelContext
Plugin model context for fair election computation.
Supplies parameters that configure how the
Self::FairElectionModel behaves at runtime.
Enables dynamic tuning of election policies without modifying the model implementation or pallet logic.
Must match the context type expected by the selected
Self::FairElectionModel.
Sourcetype WeightInfo: WeightInfo
type WeightInfo: WeightInfo
Weight information for extrinsics in this pallet.
type EmitEvents: Get<bool> + Clone + Debug
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.