Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve_unstake #1057

Merged
merged 1 commit into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading