Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 4f4e456

Browse files
committed
use DefaultConfig
- #13454
1 parent 27364b1 commit 4f4e456

File tree

2 files changed

+8
-2
lines changed
  • frame/examples
    • offchain-worker-ping-pong/src
    • offchain-worker-price-oracle/src

2 files changed

+8
-2
lines changed

frame/examples/offchain-worker-ping-pong/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,14 @@ pub mod pallet {
158158
use frame_system::pallet_prelude::*;
159159

160160
/// This pallet's configuration trait
161-
#[pallet::config]
161+
#[pallet::config(with_default)]
162162
pub trait Config: CreateSignedTransaction<Call<Self>> + frame_system::Config {
163163
/// The identifier type for an offchain worker.
164+
#[pallet::no_default]
164165
type AuthorityId: AppCrypto<Self::Public, Self::Signature>;
165166

166167
/// The overarching event type.
168+
#[pallet::no_default]
167169
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
168170

169171
// Configuration parameters
@@ -172,6 +174,7 @@ pub mod pallet {
172174
///
173175
/// This ensures that we only accept unsigned transactions once, every `UnsignedInterval`
174176
/// blocks.
177+
#[pallet::no_default]
175178
#[pallet::constant]
176179
type UnsignedInterval: Get<Self::BlockNumber>;
177180

frame/examples/offchain-worker-price-oracle/src/lib.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -133,19 +133,22 @@ pub mod pallet {
133133
use frame_system::pallet_prelude::*;
134134

135135
/// This pallet's configuration trait
136-
#[pallet::config]
136+
#[pallet::config(with_default)]
137137
pub trait Config: CreateSignedTransaction<Call<Self>> + frame_system::Config {
138138
/// The identifier type for an offchain worker.
139+
#[pallet::no_default]
139140
type AuthorityId: AppCrypto<Self::Public, Self::Signature>;
140141

141142
/// The overarching event type.
143+
#[pallet::no_default]
142144
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
143145

144146
/// A grace period after we send transaction.
145147
///
146148
/// To avoid sending too many transactions, we only attempt to send one
147149
/// every `GRACE_PERIOD` blocks. We use Local Storage to coordinate
148150
/// sending between distinct runs of this offchain worker.
151+
#[pallet::no_default]
149152
#[pallet::constant]
150153
type GracePeriod: Get<Self::BlockNumber>;
151154

0 commit comments

Comments
 (0)