git.delta.rocks / unique-network / refs/commits / 620331699fb8

difftreelog

feat(app-promo) added `FreezeIdentifier` to runtime impl

PraetorP2023-05-22parent: #af51a41.patch.diff
in: master
Added `MaxFreezes` to `pallet_balances::Config`

3 files changed

modifiedpallets/app-promotion/src/lib.rsdiffbeforeafterboth
--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -826,7 +826,11 @@
 
 		///  Migrates lock state into freeze one
 		///
-		///  # Arguments
+		/// # Permissions
+		///
+		/// * Sudo
+		///
+		///   # Arguments
 		///
 		/// * `origin`: Must be `Signed`.
 		/// * `stakers`: Accounts to be upgraded.
@@ -836,7 +840,7 @@
 			origin: OriginFor<T>,
 			stakers: Vec<T::AccountId>,
 		) -> DispatchResult {
-			ensure_signed(origin)?;
+			ensure_root(origin)?;
 
 			stakers
 				.into_iter()
modifiedruntime/common/config/pallets/app_promotion.rsdiffbeforeafterboth
--- a/runtime/common/config/pallets/app_promotion.rs
+++ b/runtime/common/config/pallets/app_promotion.rs
@@ -31,6 +31,7 @@
 	pub const RecalculationInterval: BlockNumber = RELAY_DAYS;
 	pub const PendingInterval: BlockNumber = 7 * DAYS;
 	pub const Nominal: Balance = UNIQUE;
+	pub const HoldAndFreezeIdentifier: [u8; 16] = *b"appstakeappstake";
 	pub IntervalIncome: Perbill = Perbill::from_rational(5u32, 10_000);
 }
 
@@ -47,4 +48,5 @@
 	type Nominal = Nominal;
 	type IntervalIncome = IntervalIncome;
 	type RuntimeEvent = RuntimeEvent;
+	type FreezeIdentifier = HoldAndFreezeIdentifier;
 }
modifiedruntime/common/config/substrate.rsdiffbeforeafterboth
132 pub const ExistentialDeposit: u128 = EXISTENTIAL_DEPOSIT;132 pub const ExistentialDeposit: u128 = EXISTENTIAL_DEPOSIT;
133 pub const MaxLocks: u32 = 50;133 pub const MaxLocks: u32 = 50;
134 pub const MaxReserves: u32 = 50;134 pub const MaxReserves: u32 = 50;
135 pub const MaxFreezes: u32 = 20;
135}136}
136137
137impl pallet_balances::Config for Runtime {138impl pallet_balances::Config for Runtime {
150 type HoldIdentifier = [u8; 16];151 type HoldIdentifier = [u8; 16];
151 type FreezeIdentifier = [u8; 16];152 type FreezeIdentifier = [u8; 16];
152 type MaxHolds = ();153 type MaxHolds = ();
153 type MaxFreezes = ();154 type MaxFreezes = MaxFreezes;
154}155}
155156
156parameter_types! {157parameter_types! {