referrerpolicy=no-referrer-when-downgrade
pallet_origin_restriction::pallet

Trait Config

Source
pub trait Config:
    Config<RuntimeCall: Dispatchable<Info = DispatchInfo, PostInfo = PostDispatchInfo>, RuntimeOrigin: AsTransactionAuthorizedOrigin>
    + Config
    + Send
    + Sync
    + Config<RuntimeEvent: From<Event<Self>>> {
    type WeightInfo: WeightInfo;
    type RestrictedEntity: RestrictedEntity<<<Self as Config>::RuntimeOrigin as OriginTrait>::PalletsOrigin, <<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance> + Parameter + MaxEncodedLen;
    type OperationAllowedOneTimeExcess: ContainsPair<Self::RestrictedEntity, Self::RuntimeCall>;
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
}
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 WeightInfo: WeightInfo

The weight information for this pallet.

Source

type RestrictedEntity: RestrictedEntity<<<Self as Config>::RuntimeOrigin as OriginTrait>::PalletsOrigin, <<Self as Config>::OnChargeTransaction as OnChargeTransaction<Self>>::Balance> + Parameter + MaxEncodedLen

The type that represent the entities tracked, its allowance and the conversion from origin is bounded in RestrictedEntity.

This is the canonical origin from the point of view of usage tracking. Each entity is tracked separately.

This is different from origin as a multiple origin can represent a single entity. For example, imagine a DAO origin with a percentage of voters, we want to track the DAO entity regardless of the voter percentage.

Source

type OperationAllowedOneTimeExcess: ContainsPair<Self::RestrictedEntity, Self::RuntimeCall>

For some entities, the calls that are allowed to go beyond the max allowance.

This must be only for call which have a reasonable maximum weight and length.

Source

type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>

The runtime event type.

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§