git.delta.rocks / unique-network / refs/commits / eee52efe2cf2

difftreelog

fix cargo fmt

Daniel Shiposha2022-09-20parent: #8ca43b5.patch.diff
in: master

3 files changed

modifiedpallets/scheduler/src/lib.rsdiffbeforeafterboth
199 pallet_prelude::*,199 pallet_prelude::*,
200 traits::{schedule::{LookupError, LOWEST_PRIORITY}, PreimageProvider},200 traits::{
201 schedule::{LookupError, LOWEST_PRIORITY},
202 PreimageProvider,
203 },
201 };204 };
202 use frame_system::pallet_prelude::*;205 use frame_system::pallet_prelude::*;
241 /// Required origin to schedule or cancel calls.244 /// Required origin to schedule or cancel calls.
242 type ScheduleOrigin: EnsureOrigin<<Self as system::Config>::RuntimeOrigin, Success = ScheduledEnsureOriginSuccess<Self::AccountId>>;245 type ScheduleOrigin: EnsureOrigin<
246 <Self as system::Config>::RuntimeOrigin,
247 Success = ScheduledEnsureOriginSuccess<Self::AccountId>,
248 >;
243249
244 /// Required origin to set/change calls' priority.250 /// Required origin to set/change calls' priority.
453 match ensured_origin {461 match ensured_origin {
454 ScheduledEnsureOriginSuccess::Root => {462 ScheduledEnsureOriginSuccess::Root => {
455 r = Ok(call.dispatch_bypass_filter(frame_system::RawOrigin::Root.into()));463 r = Ok(call.dispatch_bypass_filter(frame_system::RawOrigin::Root.into()));
456 },464 }
457 ScheduledEnsureOriginSuccess::Signed(sender) => {465 ScheduledEnsureOriginSuccess::Signed(sender) => {
458 // Execute transaction via chain default pipeline466 // Execute transaction via chain default pipeline
459 // That means dispatch will be processed like any user's extrinsic e.g. transaction fees will be taken467 // That means dispatch will be processed like any user's extrinsic e.g. transaction fees will be taken
460 r = T::CallExecutor::dispatch_call(Some(sender), call.clone());468 r = T::CallExecutor::dispatch_call(Some(sender), call.clone());
461 },469 }
462 ScheduledEnsureOriginSuccess::Unsigned => {470 ScheduledEnsureOriginSuccess::Unsigned => {
463 // Unsigned version of the above471 // Unsigned version of the above
464 r = T::CallExecutor::dispatch_call(None, call.clone());472 r = T::CallExecutor::dispatch_call(None, call.clone());
779 Self::deposit_event(Event::PriorityChanged { when, index, priority });787 Self::deposit_event(Event::PriorityChanged {
788 when,
789 index,
790 priority,
791 });
780 }792 }
781 Ok(())793 Ok(())
782 })794 })
783 },795 }
784 None => Err(Error::<T>::NotFound.into())796 None => Err(Error::<T>::NotFound.into()),
785 }797 }
786 }798 }
787}799}
modifiedruntime/common/config/pallets/scheduler.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/scheduler.rs
+++ b/runtime/common/config/pallets/scheduler.rs
@@ -14,7 +14,11 @@
 // You should have received a copy of the GNU General Public License
 // along with Unique Network. If not, see <http://www.gnu.org/licenses/>.
 
-use frame_support::{traits::{PrivilegeCmp, EnsureOrigin}, weights::Weight, parameter_types};
+use frame_support::{
+	traits::{PrivilegeCmp, EnsureOrigin},
+	weights::Weight,
+	parameter_types,
+};
 use frame_system::{EnsureRoot, RawOrigin};
 use sp_runtime::Perbill;
 use core::cmp::Ordering;
@@ -37,7 +41,8 @@
 
 pub struct EnsureSignedOrRoot<AccountId>(sp_std::marker::PhantomData<AccountId>);
 impl<O: Into<Result<RawOrigin<AccountId>, O>> + From<RawOrigin<AccountId>>, AccountId: Decode>
-	EnsureOrigin<O> for EnsureSignedOrRoot<AccountId> {
+	EnsureOrigin<O> for EnsureSignedOrRoot<AccountId>
+{
 	type Success = ScheduledEnsureOriginSuccess<AccountId>;
 	fn try_origin(o: O) -> Result<Self::Success, O> {
 		o.into().and_then(|o| match o {
@@ -60,7 +65,7 @@
 			(Root, Root) => Some(Ordering::Equal),
 			(Root, _) => Some(Ordering::Greater),
 			(_, Root) => Some(Ordering::Less),
-			lr @ _ => (lr.0 == lr.1).then(|| Ordering::Equal)
+			lr @ _ => (lr.0 == lr.1).then(|| Ordering::Equal),
 		}
 	}
 }
modifiedruntime/common/scheduler.rsdiffbeforeafterboth
--- a/runtime/common/scheduler.rs
+++ b/runtime/common/scheduler.rs
@@ -84,10 +84,13 @@
 		let len = call.encoded_size();
 
 		let signed = match signer {
-			Some(signer) => fp_self_contained::CheckedSignature::Signed(signer.clone().into(), get_signed_extras(signer.into())),
+			Some(signer) => fp_self_contained::CheckedSignature::Signed(
+				signer.clone().into(),
+				get_signed_extras(signer.into()),
+			),
 			None => fp_self_contained::CheckedSignature::Unsigned,
 		};
-		
+
 		let extrinsic = fp_self_contained::CheckedExtrinsic::<
 			AccountId,
 			Call,