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
825 }825 }
826826
827 /// Migrates lock state into freeze one827 /// Migrates lock state into freeze one
828 ///
829 /// # Permissions
830 ///
831 /// * Sudo
828 ///832 ///
829 /// # Arguments833 /// # Arguments
830 ///834 ///
831 /// * `origin`: Must be `Signed`.835 /// * `origin`: Must be `Signed`.
832 /// * `stakers`: Accounts to be upgraded.836 /// * `stakers`: Accounts to be upgraded.
836 origin: OriginFor<T>,840 origin: OriginFor<T>,
837 stakers: Vec<T::AccountId>,841 stakers: Vec<T::AccountId>,
838 ) -> DispatchResult {842 ) -> DispatchResult {
839 ensure_signed(origin)?;843 ensure_root(origin)?;
840844
841 stakers845 stakers
842 .into_iter()846 .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
--- a/runtime/common/config/substrate.rs
+++ b/runtime/common/config/substrate.rs
@@ -132,6 +132,7 @@
 	pub const ExistentialDeposit: u128 = EXISTENTIAL_DEPOSIT;
 	pub const MaxLocks: u32 = 50;
 	pub const MaxReserves: u32 = 50;
+	pub const MaxFreezes: u32 = 20;
 }
 
 impl pallet_balances::Config for Runtime {
@@ -150,7 +151,7 @@
 	type HoldIdentifier = [u8; 16];
 	type FreezeIdentifier = [u8; 16];
 	type MaxHolds = ();
-	type MaxFreezes = ();
+	type MaxFreezes = MaxFreezes;
 }
 
 parameter_types! {