18
18
//! # Utility Module
19
19
//! A stateless module with helpers for dispatch management which does no re-authentication.
20
20
//!
21
- //! - [`utility::Trait `](./trait.Trait .html)
21
+ //! - [`utility::Config `](./trait.Config .html)
22
22
//! - [`Call`](./enum.Call.html)
23
23
//!
24
24
//! ## Overview
50
50
//! * `as_derivative` - Dispatch a call from a derivative signed origin.
51
51
//!
52
52
//! [`Call`]: ./enum.Call.html
53
- //! [`Trait `]: ./trait.Trait .html
53
+ //! [`Config `]: ./trait.Config .html
54
54
55
55
// Ensure we're `no_std` when compiling for Wasm.
56
56
#![ cfg_attr( not( feature = "std" ) , no_std) ]
@@ -74,9 +74,9 @@ use sp_runtime::{DispatchError, traits::Dispatchable};
74
74
pub use weights:: WeightInfo ;
75
75
76
76
/// Configuration trait.
77
- pub trait Trait : frame_system:: Trait {
77
+ pub trait Config : frame_system:: Config {
78
78
/// The overarching event type.
79
- type Event : From < Event > + Into < <Self as frame_system:: Trait >:: Event > ;
79
+ type Event : From < Event > + Into < <Self as frame_system:: Config >:: Event > ;
80
80
81
81
/// The overarching call type.
82
82
type Call : Parameter + Dispatchable < Origin =Self :: Origin , PostInfo =PostDispatchInfo >
@@ -88,7 +88,7 @@ pub trait Trait: frame_system::Trait {
88
88
}
89
89
90
90
decl_storage ! {
91
- trait Store for Module <T : Trait > as Utility { }
91
+ trait Store for Module <T : Config > as Utility { }
92
92
}
93
93
94
94
decl_event ! {
@@ -111,7 +111,7 @@ impl TypeId for IndexedUtilityModuleId {
111
111
}
112
112
113
113
decl_module ! {
114
- pub struct Module <T : Trait > for enum Call where origin: T :: Origin {
114
+ pub struct Module <T : Config > for enum Call where origin: T :: Origin {
115
115
/// Deposit one of this module's events by using the default implementation.
116
116
fn deposit_event( ) = default ;
117
117
@@ -122,7 +122,7 @@ decl_module! {
122
122
/// - `calls`: The calls to be dispatched from the same origin.
123
123
///
124
124
/// If origin is root then call are dispatch without checking origin filter. (This includes
125
- /// bypassing `frame_system::Trait ::BaseCallFilter`).
125
+ /// bypassing `frame_system::Config ::BaseCallFilter`).
126
126
///
127
127
/// # <weight>
128
128
/// - Complexity: O(C) where C is the number of calls to be batched.
@@ -149,7 +149,7 @@ decl_module! {
149
149
}
150
150
} ,
151
151
) ]
152
- fn batch( origin, calls: Vec <<T as Trait >:: Call >) -> DispatchResultWithPostInfo {
152
+ fn batch( origin, calls: Vec <<T as Config >:: Call >) -> DispatchResultWithPostInfo {
153
153
let is_root = ensure_root( origin. clone( ) ) . is_ok( ) ;
154
154
let calls_len = calls. len( ) ;
155
155
// Track the actual weight of each of the batch calls.
@@ -197,7 +197,7 @@ decl_module! {
197
197
. saturating_add( T :: DbWeight :: get( ) . reads_writes( 1 , 1 ) ) ,
198
198
call. get_dispatch_info( ) . class,
199
199
) ]
200
- fn as_derivative( origin, index: u16 , call: Box <<T as Trait >:: Call >) -> DispatchResultWithPostInfo {
200
+ fn as_derivative( origin, index: u16 , call: Box <<T as Config >:: Call >) -> DispatchResultWithPostInfo {
201
201
let mut origin = origin;
202
202
let who = ensure_signed( origin. clone( ) ) ?;
203
203
let pseudonym = Self :: derivative_account_id( who, index) ;
@@ -222,7 +222,7 @@ decl_module! {
222
222
/// - `calls`: The calls to be dispatched from the same origin.
223
223
///
224
224
/// If origin is root then call are dispatch without checking origin filter. (This includes
225
- /// bypassing `frame_system::Trait ::BaseCallFilter`).
225
+ /// bypassing `frame_system::Config ::BaseCallFilter`).
226
226
///
227
227
/// # <weight>
228
228
/// - Complexity: O(C) where C is the number of calls to be batched.
@@ -244,7 +244,7 @@ decl_module! {
244
244
} ,
245
245
) ]
246
246
#[ transactional]
247
- fn batch_all( origin, calls: Vec <<T as Trait >:: Call >) -> DispatchResultWithPostInfo {
247
+ fn batch_all( origin, calls: Vec <<T as Config >:: Call >) -> DispatchResultWithPostInfo {
248
248
let is_root = ensure_root( origin. clone( ) ) . is_ok( ) ;
249
249
let calls_len = calls. len( ) ;
250
250
// Track the actual weight of each of the batch calls.
@@ -274,7 +274,7 @@ decl_module! {
274
274
}
275
275
}
276
276
277
- impl < T : Trait > Module < T > {
277
+ impl < T : Config > Module < T > {
278
278
/// Derive a derivative account ID from the owner account and the sub-account index.
279
279
pub fn derivative_account_id ( who : T :: AccountId , index : u16 ) -> T :: AccountId {
280
280
let entropy = ( b"modlpy/utilisuba" , who, index) . using_encoded ( blake2_256) ;
0 commit comments