@@ -115,6 +115,16 @@ use sp_timestamp::{
115
115
OnTimestampSet ,
116
116
} ;
117
117
118
+ pub trait WeightInfo {
119
+ fn set ( t : u32 , ) -> Weight ;
120
+ fn on_finalize ( t : u32 , ) -> Weight ;
121
+ }
122
+
123
+ impl WeightInfo for ( ) {
124
+ fn set ( _t : u32 , ) -> Weight { 1_000_000_000 }
125
+ fn on_finalize ( _t : u32 , ) -> Weight { 1_000_000_000 }
126
+ }
127
+
118
128
/// The module configuration trait
119
129
pub trait Trait : frame_system:: Trait {
120
130
/// Type used for expressing timestamp.
@@ -129,6 +139,9 @@ pub trait Trait: frame_system::Trait {
129
139
/// work with this to determine a sensible block time. e.g. For Aura, it will be double this
130
140
/// period on default settings.
131
141
type MinimumPeriod : Get < Self :: Moment > ;
142
+
143
+ /// Weight information for extrinsics in this pallet.
144
+ type WeightInfo : WeightInfo ;
132
145
}
133
146
134
147
decl_module ! {
@@ -338,6 +351,7 @@ mod tests {
338
351
type AccountData = ( ) ;
339
352
type OnNewAccount = ( ) ;
340
353
type OnKilledAccount = ( ) ;
354
+ type SystemWeightInfo = ( ) ;
341
355
}
342
356
parameter_types ! {
343
357
pub const MinimumPeriod : u64 = 5 ;
@@ -346,6 +360,7 @@ mod tests {
346
360
type Moment = u64 ;
347
361
type OnTimestampSet = ( ) ;
348
362
type MinimumPeriod = MinimumPeriod ;
363
+ type WeightInfo = ( ) ;
349
364
}
350
365
type Timestamp = Module < Test > ;
351
366
0 commit comments