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

difftreelog

resolve_unstake

PraetorP2024-03-21parent: #f29e16f.patch.diff
in: master

5 files changed

modifiedCargo.lockdiffbeforeafterboth
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -6814,7 +6814,7 @@
 
 [[package]]
 name = "pallet-app-promotion"
-version = "0.2.1"
+version = "0.2.2"
 dependencies = [
  "frame-benchmarking",
  "frame-support",
modifiedjs-packages/scripts/correctStateAfterMaintenance.tsdiffbeforeafterboth
--- a/js-packages/scripts/correctStateAfterMaintenance.ts
+++ b/js-packages/scripts/correctStateAfterMaintenance.ts
@@ -37,7 +37,7 @@
     const signer = await privateKey(options.donorSeed);
 
     const txs = skippedBlocks.map((b) =>
-      api.tx.sudo.sudo(api.tx.appPromotion.forceUnstake(b)));
+      api.tx.appPromotion.resolveSkippedBlocks(b));
 
 
     const promises = txs.map((tx) => () => helper.signTransaction(signer, tx));
modifiedpallets/app-promotion/CHANGELOG.mddiffbeforeafterboth
before · pallets/app-promotion/CHANGELOG.md
1# Change Log23All notable changes to this project will be documented in this file.45<!-- bureaucrate goes here -->67## [0.2.1] - 2023-06-2389### Changed1011- Removed types associated with support for `Currency` trait.1213### Fixed1415- Benchmarks.16  17## [0.2.0] - 2023-05-191819### Changed2021- **Breaking:** migration from `Currency` traits to `Fungible` ones in constraints22  for `Config::Currency` associated type.2324## [0.1.6] - 2023-04-192526- ### Fixed2728- Useless `on_runtime_upgrade()` has been removed2930## [0.1.5] - 2023-02-143132### Added3334- `unstake_partial` extrinsic.3536## [0.1.4] - 2023-01-313738### Changed3940- Balance reservation when calling the unstake method is removed.41  Now the locked balance (by AppPromo) does not change until the unlock interval expires.4243## [0.1.3] - 2022-12-254445### Fixed4647- Benchmarks for `payoutStakers` and `unstake` extrinsics.4849## [0.1.2] - 2022-12-205051### Fixed5253- The behaviour of the `payoutStakers` extrinsic54  in which only one stake is calculated for the last processed staker.5556## [0.1.1] - 2022-12-135758### Added5960- The ability to configure pallet `app-promotion` via the `configuration` pallet.
modifiedpallets/app-promotion/Cargo.tomldiffbeforeafterboth
--- a/pallets/app-promotion/Cargo.toml
+++ b/pallets/app-promotion/Cargo.toml
@@ -9,7 +9,7 @@
 license = 'GPLv3'
 name = 'pallet-app-promotion'
 repository = 'https://github.com/UniqueNetwork/unique-chain'
-version = '0.2.1'
+version = '0.2.2'
 
 [package.metadata.docs.rs]
 targets = ['x86_64-unknown-linux-gnu']
modifiedpallets/app-promotion/src/lib.rsdiffbeforeafterboth
--- a/pallets/app-promotion/src/lib.rs
+++ b/pallets/app-promotion/src/lib.rs
@@ -689,21 +689,18 @@
 
 		/// Called for blocks that, for some reason, have not been unstacked
 		///
-		/// # Permissions
-		///
-		/// * Sudo
 		///
 		///   # Arguments
 		///
-		/// * `origin`: Must be `Root`.
+		/// * `origin`: Must be `Signed`.
 		/// * `pending_blocks`: Block numbers that will be processed.
 		#[pallet::call_index(9)]
 		#[pallet::weight(<T as Config>::WeightInfo::on_initialize(PENDING_LIMIT_PER_BLOCK*pending_blocks.len() as u32))]
-		pub fn force_unstake(
+		pub fn resolve_skipped_blocks(
 			origin: OriginFor<T>,
 			pending_blocks: Vec<BlockNumberFor<T>>,
 		) -> DispatchResult {
-			ensure_root(origin)?;
+			ensure_signed(origin)?;
 
 			ensure!(
 				pending_blocks