@@ -130,7 +130,10 @@ decl_module! {
130
130
/// - One DB write (event).
131
131
/// - Weight of derivative `call` execution + 10,000.
132
132
/// # </weight>
133
- #[ weight = ( call. get_dispatch_info( ) . weight + 10_000 , call. get_dispatch_info( ) . class) ]
133
+ #[ weight = {
134
+ let dispatch_info = call. get_dispatch_info( ) ;
135
+ ( dispatch_info. weight. saturating_add( 10_000 ) , dispatch_info. class)
136
+ } ]
134
137
fn sudo( origin, call: Box <<T as Config >:: Call >) -> DispatchResultWithPostInfo {
135
138
// This is a public call, so we ensure that the origin is some signed account.
136
139
let sender = ensure_signed( origin) ?;
@@ -197,13 +200,16 @@ decl_module! {
197
200
/// - One DB write (event).
198
201
/// - Weight of derivative `call` execution + 10,000.
199
202
/// # </weight>
200
- #[ weight = (
201
- call. get_dispatch_info( ) . weight
202
- . saturating_add( 10_000 )
203
- // AccountData for inner call origin accountdata.
204
- . saturating_add( T :: DbWeight :: get( ) . reads_writes( 1 , 1 ) ) ,
205
- call. get_dispatch_info( ) . class
206
- ) ]
203
+ #[ weight = {
204
+ let dispatch_info = call. get_dispatch_info( ) ;
205
+ (
206
+ dispatch_info. weight
207
+ . saturating_add( 10_000 )
208
+ // AccountData for inner call origin accountdata.
209
+ . saturating_add( T :: DbWeight :: get( ) . reads_writes( 1 , 1 ) ) ,
210
+ dispatch_info. class,
211
+ )
212
+ } ]
207
213
fn sudo_as( origin,
208
214
who: <T :: Lookup as StaticLookup >:: Source ,
209
215
call: Box <<T as Config >:: Call >
0 commit comments