@@ -201,6 +201,66 @@ type BalanceOf<T> = <<T as Trait>::Currency as Currency<<T as frame_system::Trai
201
201
type NegativeImbalanceOf < T > =
202
202
<<T as Trait >:: Currency as Currency < <T as frame_system:: Trait >:: AccountId > >:: NegativeImbalance ;
203
203
204
+ pub trait WeightInfo {
205
+ fn propose ( p : u32 , ) -> Weight ;
206
+ fn second ( s : u32 , ) -> Weight ;
207
+ fn vote_new ( r : u32 , ) -> Weight ;
208
+ fn vote_existing ( r : u32 , ) -> Weight ;
209
+ fn emergency_cancel ( r : u32 , ) -> Weight ;
210
+ fn external_propose ( p : u32 , v : u32 , ) -> Weight ;
211
+ fn external_propose_majority ( p : u32 , ) -> Weight ;
212
+ fn external_propose_default ( p : u32 , ) -> Weight ;
213
+ fn fast_track ( p : u32 , ) -> Weight ;
214
+ fn veto_external ( v : u32 , ) -> Weight ;
215
+ fn cancel_referendum ( r : u32 , ) -> Weight ;
216
+ fn cancel_queued ( r : u32 , ) -> Weight ;
217
+ fn on_initialize_external ( r : u32 , ) -> Weight ;
218
+ fn on_initialize_public ( r : u32 , ) -> Weight ;
219
+ fn on_initialize_no_launch_no_maturing ( r : u32 , ) -> Weight ;
220
+ fn delegate ( r : u32 , ) -> Weight ;
221
+ fn undelegate ( r : u32 , ) -> Weight ;
222
+ fn clear_public_proposals ( p : u32 , ) -> Weight ;
223
+ fn note_preimage ( b : u32 , ) -> Weight ;
224
+ fn note_imminent_preimage ( b : u32 , ) -> Weight ;
225
+ fn reap_preimage ( b : u32 , ) -> Weight ;
226
+ fn unlock_remove ( r : u32 , ) -> Weight ;
227
+ fn unlock_set ( r : u32 , ) -> Weight ;
228
+ fn remove_vote ( r : u32 , ) -> Weight ;
229
+ fn remove_other_vote ( r : u32 , ) -> Weight ;
230
+ fn enact_proposal_execute ( b : u32 , ) -> Weight ;
231
+ fn enact_proposal_slash ( b : u32 , ) -> Weight ;
232
+ }
233
+
234
+ impl WeightInfo for ( ) {
235
+ fn propose ( _p : u32 , ) -> Weight { 1_000_000_000 }
236
+ fn second ( _s : u32 , ) -> Weight { 1_000_000_000 }
237
+ fn vote_new ( _r : u32 , ) -> Weight { 1_000_000_000 }
238
+ fn vote_existing ( _r : u32 , ) -> Weight { 1_000_000_000 }
239
+ fn emergency_cancel ( _r : u32 , ) -> Weight { 1_000_000_000 }
240
+ fn external_propose ( _p : u32 , _v : u32 , ) -> Weight { 1_000_000_000 }
241
+ fn external_propose_majority ( _p : u32 , ) -> Weight { 1_000_000_000 }
242
+ fn external_propose_default ( _p : u32 , ) -> Weight { 1_000_000_000 }
243
+ fn fast_track ( _p : u32 , ) -> Weight { 1_000_000_000 }
244
+ fn veto_external ( _v : u32 , ) -> Weight { 1_000_000_000 }
245
+ fn cancel_referendum ( _r : u32 , ) -> Weight { 1_000_000_000 }
246
+ fn cancel_queued ( _r : u32 , ) -> Weight { 1_000_000_000 }
247
+ fn on_initialize_external ( _r : u32 , ) -> Weight { 1_000_000_000 }
248
+ fn on_initialize_public ( _r : u32 , ) -> Weight { 1_000_000_000 }
249
+ fn on_initialize_no_launch_no_maturing ( _r : u32 , ) -> Weight { 1_000_000_000 }
250
+ fn delegate ( _r : u32 , ) -> Weight { 1_000_000_000 }
251
+ fn undelegate ( _r : u32 , ) -> Weight { 1_000_000_000 }
252
+ fn clear_public_proposals ( _p : u32 , ) -> Weight { 1_000_000_000 }
253
+ fn note_preimage ( _b : u32 , ) -> Weight { 1_000_000_000 }
254
+ fn note_imminent_preimage ( _b : u32 , ) -> Weight { 1_000_000_000 }
255
+ fn reap_preimage ( _b : u32 , ) -> Weight { 1_000_000_000 }
256
+ fn unlock_remove ( _r : u32 , ) -> Weight { 1_000_000_000 }
257
+ fn unlock_set ( _r : u32 , ) -> Weight { 1_000_000_000 }
258
+ fn remove_vote ( _r : u32 , ) -> Weight { 1_000_000_000 }
259
+ fn remove_other_vote ( _r : u32 , ) -> Weight { 1_000_000_000 }
260
+ fn enact_proposal_execute ( _b : u32 , ) -> Weight { 1_000_000_000 }
261
+ fn enact_proposal_slash ( _b : u32 , ) -> Weight { 1_000_000_000 }
262
+ }
263
+
204
264
pub trait Trait : frame_system:: Trait + Sized {
205
265
type Proposal : Parameter + Dispatchable < Origin =Self :: Origin > + From < Call < Self > > ;
206
266
type Event : From < Event < Self > > + Into < <Self as frame_system:: Trait >:: Event > ;
@@ -289,6 +349,9 @@ pub trait Trait: frame_system::Trait + Sized {
289
349
/// Also used to compute weight, an overly big value can
290
350
/// lead to extrinsic with very big weight: see `delegate` for instance.
291
351
type MaxVotes : Get < u32 > ;
352
+
353
+ /// Weight information for extrinsics in this pallet.
354
+ type WeightInfo : WeightInfo ;
292
355
}
293
356
294
357
#[ derive( Clone , Encode , Decode , RuntimeDebug ) ]
0 commit comments