Skip to content

Commit

Permalink
Merge pull request #1057 from UniqueNetwork/feature/resolve-skipped-b…
Browse files Browse the repository at this point in the history
…locks

resolve_unstake
  • Loading branch information
CertainLach authored Mar 22, 2024
2 parents f29e16f + b2966bb commit c748379
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion js-packages/scripts/correctStateAfterMaintenance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const main = async(options: { wsEndpoint: string; donorSeed: string } = {
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));
Expand Down
6 changes: 6 additions & 0 deletions pallets/app-promotion/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.

<!-- 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
Expand Down
2 changes: 1 addition & 1 deletion pallets/app-promotion/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ homepage = 'https://unique.network'
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']
Expand Down
9 changes: 3 additions & 6 deletions pallets/app-promotion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,21 +689,18 @@ pub mod pallet {

/// 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
Expand Down

0 comments on commit c748379

Please sign in to comment.