referrerpolicy=no-referrer-when-downgrade

Config

Trait Config 

Source
pub trait Config: Config + Config<RuntimeEvent: From<Event<Self>>> {
    type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo + From<Call<Self>> + IsSubType<Call<Self>> + IsType<<Self as Config>::RuntimeCall>;
    type RuntimeHoldReason: Parameter + Member + MaxEncodedLen + Copy + VariantCount + From<HoldReason>;
    type BlockNumberProvider: BlockNumberProvider;
    type Currency: MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason> + Balanced<Self::AccountId> + Mutate<Self::AccountId>;
    type FriendGroupsConsideration: Consideration<Self::AccountId, Footprint>;
    type AttemptConsideration: Consideration<Self::AccountId, Footprint>;
    type InheritorConsideration: Consideration<Self::AccountId, Footprint>;
    type SecurityDeposit: Get<BalanceOf<Self>>;
    type Slash: OnUnbalanced<CreditOf<Self>>;
    type MaxFriendsPerConfig: Get<u32>;
    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§

Source

type RuntimeCall: Parameter + Dispatchable<RuntimeOrigin = Self::RuntimeOrigin, PostInfo = PostDispatchInfo> + GetDispatchInfo + From<Call<Self>> + IsSubType<Call<Self>> + IsType<<Self as Config>::RuntimeCall>

The overarching call type.

Source

type RuntimeHoldReason: Parameter + Member + MaxEncodedLen + Copy + VariantCount + From<HoldReason>

The overarching hold reason.

Source

type BlockNumberProvider: BlockNumberProvider

Query the block number that will be used to measure time.

Must return monotonically increasing values when called from consecutive blocks. Can be configured to return either:

  • the local block number of the runtime via frame_system::Pallet
  • a remote block number, eg from the relay chain through RelaychainDataProvider
  • an arbitrary value through a custom implementation of the trait

There is currently no migration provided to “hot-swap” block number providers and it may result in undefined behavior when doing so. Parachains are therefore best off setting this to their local block number provider if they have the pallet already deployed.

Suggested values:

  • Solo- and Relay-chains: frame_system::Pallet
  • Parachains that may produce blocks sparingly or only when needed (on-demand):
    • already have the pallet deployed: frame_system::Pallet
    • are freshly deploying this pallet: RelaychainDataProvider
  • Parachains with a reliably block production rate (PLO or bulk-coretime):
    • already have the pallet deployed: frame_system::Pallet
    • are freshly deploying this pallet: no strong recommendation. Both local and remote providers can be used. Relay provider can be a bit better in cases where the parachain is lagging its block production to avoid clock skew.
Source

type Currency: MutateHold<Self::AccountId, Reason = Self::RuntimeHoldReason> + Balanced<Self::AccountId> + Mutate<Self::AccountId>

Source

type FriendGroupsConsideration: Consideration<Self::AccountId, Footprint>

Storage consideration for holding friend group configs.

Source

type AttemptConsideration: Consideration<Self::AccountId, Footprint>

Storage consideration for holding an attempt.

Source

type InheritorConsideration: Consideration<Self::AccountId, Footprint>

Storage consideration for holding an inheritor.

Source

type SecurityDeposit: Get<BalanceOf<Self>>

Security deposit taken for each attempt that the initiator needs to place.

Source

type Slash: OnUnbalanced<CreditOf<Self>>

Handler for the Credit produced when a security deposit is slashed.

Use () to drop the credit and decrease total issuance (i.e. burn). Other common choices are a treasury sink or pallet-dap.

Source

type MaxFriendsPerConfig: Get<u32>

DO NOT REDUCE THIS VALUE. Maximum number of friends per account config.

Reducing this value can cause decoding errors in the bounded vectors.

Source

type WeightInfo: WeightInfo

Weight information for extrinsics in this pallet.

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.

Implementors§