18
18
//! # Multisig Module
19
19
//! A module for doing multisig dispatch.
20
20
//!
21
- //! - [`multisig::Trait `](./trait.Trait .html)
21
+ //! - [`multisig::Config `](./trait.Config .html)
22
22
//! - [`Call`](./enum.Call.html)
23
23
//!
24
24
//! ## Overview
41
41
//! * `cancel_as_multi` - Cancel a call from a composite origin.
42
42
//!
43
43
//! [`Call`]: ./enum.Call.html
44
- //! [`Trait `]: ./trait.Trait .html
44
+ //! [`Config `]: ./trait.Config .html
45
45
46
46
// Ensure we're `no_std` when compiling for Wasm.
47
47
#![ cfg_attr( not( feature = "std" ) , no_std) ]
@@ -62,14 +62,14 @@ use frame_system::{self as system, ensure_signed, RawOrigin};
62
62
use sp_runtime:: { DispatchError , DispatchResult , traits:: { Dispatchable , Zero } } ;
63
63
pub use weights:: WeightInfo ;
64
64
65
- type BalanceOf < T > = <<T as Trait >:: Currency as Currency < <T as frame_system:: Trait >:: AccountId > >:: Balance ;
65
+ type BalanceOf < T > = <<T as Config >:: Currency as Currency < <T as frame_system:: Config >:: AccountId > >:: Balance ;
66
66
/// Just a bunch of bytes, but they should decode to a valid `Call`.
67
67
pub type OpaqueCall = Vec < u8 > ;
68
68
69
69
/// Configuration trait.
70
- pub trait Trait : frame_system:: Trait {
70
+ pub trait Config : frame_system:: Config {
71
71
/// The overarching event type.
72
- type Event : From < Event < Self > > + Into < <Self as frame_system:: Trait >:: Event > ;
72
+ type Event : From < Event < Self > > + Into < <Self as frame_system:: Config >:: Event > ;
73
73
74
74
/// The overarching call type.
75
75
type Call : Parameter + Dispatchable < Origin =Self :: Origin , PostInfo =PostDispatchInfo >
@@ -123,7 +123,7 @@ pub struct Multisig<BlockNumber, Balance, AccountId> {
123
123
}
124
124
125
125
decl_storage ! {
126
- trait Store for Module <T : Trait > as Multisig {
126
+ trait Store for Module <T : Config > as Multisig {
127
127
/// The set of open multisig operations.
128
128
pub Multisigs : double_map
129
129
hasher( twox_64_concat) T :: AccountId , hasher( blake2_128_concat) [ u8 ; 32 ]
@@ -134,7 +134,7 @@ decl_storage! {
134
134
}
135
135
136
136
decl_error ! {
137
- pub enum Error for Module <T : Trait > {
137
+ pub enum Error for Module <T : Config > {
138
138
/// Threshold must be 2 or greater.
139
139
MinimumThreshold ,
140
140
/// Call is already approved by this signatory.
@@ -169,8 +169,8 @@ decl_error! {
169
169
decl_event ! {
170
170
/// Events type.
171
171
pub enum Event <T > where
172
- AccountId = <T as system:: Trait >:: AccountId ,
173
- BlockNumber = <T as system:: Trait >:: BlockNumber ,
172
+ AccountId = <T as system:: Config >:: AccountId ,
173
+ BlockNumber = <T as system:: Config >:: BlockNumber ,
174
174
CallHash = [ u8 ; 32 ]
175
175
{
176
176
/// A new multisig operation has begun. \[approving, multisig, call_hash\]
@@ -191,7 +191,7 @@ enum CallOrHash {
191
191
}
192
192
193
193
decl_module ! {
194
- pub struct Module <T : Trait > for enum Call where origin: T :: Origin {
194
+ pub struct Module <T : Config > for enum Call where origin: T :: Origin {
195
195
type Error = Error <T >;
196
196
197
197
/// Deposit one of this module's events by using the default implementation.
@@ -232,7 +232,7 @@ decl_module! {
232
232
) ]
233
233
fn as_multi_threshold_1( origin,
234
234
other_signatories: Vec <T :: AccountId >,
235
- call: Box <<T as Trait >:: Call >,
235
+ call: Box <<T as Config >:: Call >,
236
236
) -> DispatchResultWithPostInfo {
237
237
let who = ensure_signed( origin) ?;
238
238
let max_sigs = T :: MaxSignatories :: get( ) as usize ;
@@ -443,7 +443,7 @@ decl_module! {
443
443
}
444
444
}
445
445
446
- impl < T : Trait > Module < T > {
446
+ impl < T : Config > Module < T > {
447
447
/// Derive a multi-account ID from the sorted list of accounts and the threshold that are
448
448
/// required.
449
449
///
@@ -615,7 +615,7 @@ impl<T: Trait> Module<T> {
615
615
}
616
616
617
617
/// Attempt to decode and return the call, provided by the user or from storage.
618
- fn get_call ( hash : & [ u8 ; 32 ] , maybe_known : Option < & [ u8 ] > ) -> Option < ( <T as Trait >:: Call , usize ) > {
618
+ fn get_call ( hash : & [ u8 ; 32 ] , maybe_known : Option < & [ u8 ] > ) -> Option < ( <T as Config >:: Call , usize ) > {
619
619
maybe_known. map_or_else ( || {
620
620
Calls :: < T > :: get ( hash) . and_then ( |( data, ..) | {
621
621
Decode :: decode ( & mut & data[ ..] ) . ok ( ) . map ( |d| ( d, data. len ( ) ) )
0 commit comments