pub trait Config: CreateSignedTransaction<Call<Self>> + Config {
    type AuthorityId: AppCrypto<Self::Public, Self::Signature>;
    type RuntimeEvent: From<Event<Self>> + IsType<<Self as Config>::RuntimeEvent>;
    type GracePeriod: Get<BlockNumberFor<Self>>;
    type UnsignedInterval: Get<BlockNumberFor<Self>>;
    type UnsignedPriority: Get<TransactionPriority>;
    type MaxPrices: Get<u32>;
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. This pallet’s configuration trait

Required Associated Types§


type AuthorityId: AppCrypto<Self::Public, Self::Signature>

The identifier type for an offchain worker.


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

The overarching event type.


type GracePeriod: Get<BlockNumberFor<Self>>

A grace period after we send transaction.

To avoid sending too many transactions, we only attempt to send one every GRACE_PERIOD blocks. We use Local Storage to coordinate sending between distinct runs of this offchain worker.


type UnsignedInterval: Get<BlockNumberFor<Self>>

Number of blocks of cooldown after unsigned transaction is included.

This ensures that we only accept unsigned transactions once, every UnsignedInterval blocks.


type UnsignedPriority: Get<TransactionPriority>

A configuration for base priority of unsigned transactions.

This is exposed so that it can be tuned for particular runtime, when multiple pallets send unsigned transactions.


type MaxPrices: Get<u32>

Maximum number of prices.

Object Safety§

This trait is not object safe.