@@ -78,7 +78,7 @@ use frame_support::{
78
78
traits:: { Currency , ReservableCurrency , OnUnbalanced , Get , BalanceStatus , EnsureOrigin } ,
79
79
weights:: Weight ,
80
80
} ;
81
- use frame_system:: { self as system, ensure_signed, ensure_root } ;
81
+ use frame_system:: { self as system, ensure_signed} ;
82
82
83
83
mod benchmarking;
84
84
@@ -635,9 +635,7 @@ decl_module! {
635
635
/// # </weight>
636
636
#[ weight = weight_for:: add_registrar:: <T >( T :: MaxRegistrars :: get( ) . into( ) ) ]
637
637
fn add_registrar( origin, account: T :: AccountId ) -> DispatchResultWithPostInfo {
638
- T :: RegistrarOrigin :: try_origin( origin)
639
- . map( |_| ( ) )
640
- . or_else( ensure_root) ?;
638
+ T :: RegistrarOrigin :: ensure_origin( origin) ?;
641
639
642
640
let ( i, registrar_count) = <Registrars <T >>:: try_mutate(
643
641
|registrars| -> Result <( RegistrarIndex , usize ) , DispatchError > {
@@ -1108,9 +1106,7 @@ decl_module! {
1108
1106
T :: MaxAdditionalFields :: get( ) . into( ) , // X
1109
1107
) ]
1110
1108
fn kill_identity( origin, target: <T :: Lookup as StaticLookup >:: Source ) -> DispatchResultWithPostInfo {
1111
- T :: ForceOrigin :: try_origin( origin)
1112
- . map( |_| ( ) )
1113
- . or_else( ensure_root) ?;
1109
+ T :: ForceOrigin :: ensure_origin( origin) ?;
1114
1110
1115
1111
// Figure out who we're meant to be clearing.
1116
1112
let target = T :: Lookup :: lookup( target) ?;
@@ -1435,7 +1431,7 @@ mod tests {
1435
1431
new_test_ext ( ) . execute_with ( || {
1436
1432
assert_ok ! ( Identity :: set_identity( Origin :: signed( 10 ) , ten( ) ) ) ;
1437
1433
assert_ok ! ( Identity :: set_subs( Origin :: signed( 10 ) , vec![ ( 20 , Data :: Raw ( vec![ 40 ; 1 ] ) ) ] ) ) ;
1438
- assert_ok ! ( Identity :: kill_identity( Origin :: ROOT , 10 ) ) ;
1434
+ assert_ok ! ( Identity :: kill_identity( Origin :: signed ( 2 ) , 10 ) ) ;
1439
1435
assert_eq ! ( Balances :: free_balance( 10 ) , 80 ) ;
1440
1436
assert ! ( Identity :: super_of( 20 ) . is_none( ) ) ;
1441
1437
} ) ;
0 commit comments