File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,18 @@ pub struct Heartbeat<BlockNumber>
226
226
pub validators_len : u32 ,
227
227
}
228
228
229
+ pub trait WeightInfo {
230
+ fn heartbeat ( k : u32 , e : u32 , ) -> Weight ;
231
+ fn validate_unsigned ( k : u32 , e : u32 , ) -> Weight ;
232
+ fn validate_unsigned_and_then_heartbeat ( k : u32 , e : u32 , ) -> Weight ;
233
+ }
234
+
235
+ impl WeightInfo for ( ) {
236
+ fn heartbeat ( _k : u32 , _e : u32 , ) -> Weight { 1_000_000_000 }
237
+ fn validate_unsigned ( _k : u32 , _e : u32 , ) -> Weight { 1_000_000_000 }
238
+ fn validate_unsigned_and_then_heartbeat ( _k : u32 , _e : u32 , ) -> Weight { 1_000_000_000 }
239
+ }
240
+
229
241
pub trait Trait : SendTransactionTypes < Call < Self > > + pallet_session:: historical:: Trait {
230
242
/// The identifier type for an authority.
231
243
type AuthorityId : Member + Parameter + RuntimeAppPublic + Default + Ord ;
@@ -254,6 +266,9 @@ pub trait Trait: SendTransactionTypes<Call<Self>> + pallet_session::historical::
254
266
/// This is exposed so that it can be tuned for particular runtime, when
255
267
/// multiple pallets send unsigned transactions.
256
268
type UnsignedPriority : Get < TransactionPriority > ;
269
+
270
+ /// Weight information for extrinsics in this pallet.
271
+ type WeightInfo : WeightInfo ;
257
272
}
258
273
259
274
decl_event ! (
Original file line number Diff line number Diff line change @@ -134,6 +134,7 @@ impl frame_system::Trait for Runtime {
134
134
type AccountData = ( ) ;
135
135
type OnNewAccount = ( ) ;
136
136
type OnKilledAccount = ( ) ;
137
+ type SystemWeightInfo = ( ) ;
137
138
}
138
139
139
140
parameter_types ! {
@@ -155,6 +156,7 @@ impl pallet_session::Trait for Runtime {
155
156
type Event = ( ) ;
156
157
type DisabledValidatorsThreshold = DisabledValidatorsThreshold ;
157
158
type NextSessionRotation = pallet_session:: PeriodicSessions < Period , Offset > ;
159
+ type WeightInfo = ( ) ;
158
160
}
159
161
160
162
impl pallet_session:: historical:: Trait for Runtime {
@@ -183,6 +185,7 @@ impl Trait for Runtime {
183
185
type ReportUnresponsiveness = OffenceHandler ;
184
186
type SessionDuration = Period ;
185
187
type UnsignedPriority = UnsignedPriority ;
188
+ type WeightInfo = ( ) ;
186
189
}
187
190
188
191
impl < LocalCall > frame_system:: offchain:: SendTransactionTypes < LocalCall > for Runtime where
You can’t perform that action at this time.
0 commit comments