@@ -415,7 +415,7 @@ impl<AccountId: Encode + Decode> DepositPaybackTarget<AccountId> {
415415pub mod pallet {
416416 use super :: { DispatchResult , * } ;
417417 use frame_support:: pallet_prelude:: * ;
418- use frame_system:: pallet_prelude:: * ;
418+ use frame_system:: { pallet_prelude:: * , RawOrigin } ;
419419
420420 #[ pallet:: pallet]
421421 #[ pallet:: generate_store( pub ( super ) trait Store ) ]
@@ -1071,6 +1071,11 @@ pub mod pallet {
10711071 voting_period : T :: BlockNumber ,
10721072 delay : T :: BlockNumber ,
10731073 ) -> DispatchResult {
1074+ let ( is_root, origin) = match origin. into ( ) {
1075+ Ok ( RawOrigin :: Root ) => ( true , RawOrigin :: Root . into ( ) ) ,
1076+ Ok ( other) => ( false , other. into ( ) ) ,
1077+ Err ( origin) => ( false , origin) ,
1078+ } ;
10741079 // Rather complicated bit of code to ensure that either:
10751080 // - `voting_period` is at least `FastTrackVotingPeriod` and `origin` is
10761081 // `FastTrackOrigin`; or
@@ -1093,7 +1098,7 @@ pub mod pallet {
10931098 let ( e_proposal_hash, threshold) =
10941099 <NextExternal < T > >:: get ( ) . ok_or ( Error :: < T > :: ProposalMissing ) ?;
10951100 ensure ! (
1096- threshold != VoteThreshold :: SuperMajorityApprove ,
1101+ is_root || threshold != VoteThreshold :: SuperMajorityApprove ,
10971102 Error :: <T >:: NotSimpleMajority ,
10981103 ) ;
10991104 ensure ! ( proposal_hash == e_proposal_hash, Error :: <T >:: InvalidHash ) ;
0 commit comments