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

difftreelog

Merge pull request #1057 from UniqueNetwork/feature/resolve-skipped-blocks

Yaroslav Bolyukin2024-03-22parents: #f29e16f #b2966bb.patch.diff
in: master
resolve_unstake

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
--- a/pallets/app-promotion/CHANGELOG.md
+++ b/pallets/app-promotion/CHANGELOG.md
@@ -4,6 +4,12 @@
 
 <!-- bureaucrate goes here -->
 
+## [0.2.2] - 2024-03-21
+
+### Changed
+
+- Unstake of skipped blocks is now available to `Signed` origin.
+
 ## [0.2.1] - 2023-06-23
 
 ### Changed
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
689689
690 /// Called for blocks that, for some reason, have not been unstacked690 /// Called for blocks that, for some reason, have not been unstacked
691 ///691 ///
692 /// # Permissions
693 ///
694 /// * Sudo
695 ///692 ///
696 /// # Arguments693 /// # Arguments
697 ///694 ///
698 /// * `origin`: Must be `Root`.695 /// * `origin`: Must be `Signed`.
699 /// * `pending_blocks`: Block numbers that will be processed.696 /// * `pending_blocks`: Block numbers that will be processed.
700 #[pallet::call_index(9)]697 #[pallet::call_index(9)]
701 #[pallet::weight(<T as Config>::WeightInfo::on_initialize(PENDING_LIMIT_PER_BLOCK*pending_blocks.len() as u32))]698 #[pallet::weight(<T as Config>::WeightInfo::on_initialize(PENDING_LIMIT_PER_BLOCK*pending_blocks.len() as u32))]
702 pub fn force_unstake(699 pub fn resolve_skipped_blocks(
703 origin: OriginFor<T>,700 origin: OriginFor<T>,
704 pending_blocks: Vec<BlockNumberFor<T>>,701 pending_blocks: Vec<BlockNumberFor<T>>,
705 ) -> DispatchResult {702 ) -> DispatchResult {
706 ensure_root(origin)?;703 ensure_signed(origin)?;
707704
708 ensure!(705 ensure!(
709 pending_blocks706 pending_blocks