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
--- 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
before · pallets/app-promotion/Cargo.toml
1################################################################################2# Package34[package]5authors = ['Unique Network <support@uniquenetwork.io>']6description = 'Unique App Promotion Pallet'7edition = '2021'8homepage = 'https://unique.network'9license = 'GPLv3'10name = 'pallet-app-promotion'11repository = 'https://github.com/UniqueNetwork/unique-chain'12version = '0.2.1'1314[package.metadata.docs.rs]15targets = ['x86_64-unknown-linux-gnu']1617[features]18default = ['std']19runtime-benchmarks = [20	'frame-benchmarking',21	'frame-support/runtime-benchmarks',22	'frame-system/runtime-benchmarks',23	# 'pallet-unique/runtime-benchmarks',24]25std = [26	'frame-benchmarking/std',27	'frame-support/std',28	'frame-system/std',29	'pallet-evm/std',30	'parity-scale-codec/std',31	'sp-core/std',32	'sp-runtime/std',33	'sp-std/std',3435]36try-runtime = ["frame-support/try-runtime"]3738[dependencies]39################################################################################40# Substrate Dependencies4142parity-scale-codec = { workspace = true }43scale-info = { workspace = true }4445frame-benchmarking = { workspace = true, optional = true }46frame-support = { workspace = true }47frame-system = { workspace = true }4849pallet-evm = { workspace = true }50sp-core = { workspace = true }51sp-runtime = { workspace = true }52sp-std = { workspace = true }5354################################################################################55# local dependencies5657pallet-common = { workspace = true }58pallet-configuration = { workspace = true }59pallet-evm-contract-helpers = { workspace = true }60pallet-evm-migration = { workspace = true }61pallet-unique = { workspace = true }62up-data-structs = { workspace = true }6364# [dev-dependencies]6566################################################################################67# Other6869log = { version = "0.4.20", default-features = false }
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