mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
Fixes for pallets (#4595)
* Move rebond to the end * Fix identity module * Fix order of things in tresury * Fixes * Fix. * Fix test * Fix test
This commit is contained in:
@@ -985,26 +985,6 @@ decl_module! {
|
||||
}
|
||||
}
|
||||
|
||||
/// Rebond a portion of the stash scheduled to be unlocked.
|
||||
///
|
||||
/// # <weight>
|
||||
/// - Time complexity: O(1). Bounded by `MAX_UNLOCKING_CHUNKS`.
|
||||
/// - Storage changes: Can't increase storage, only decrease it.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(500_000)]
|
||||
fn rebond(origin, #[compact] value: BalanceOf<T>) {
|
||||
let controller = ensure_signed(origin)?;
|
||||
let ledger = Self::ledger(&controller).ok_or(Error::<T>::NotController)?;
|
||||
ensure!(
|
||||
ledger.unlocking.len() > 0,
|
||||
Error::<T>::NoUnlockChunk,
|
||||
);
|
||||
|
||||
let ledger = ledger.rebond(value);
|
||||
|
||||
Self::update_ledger(&controller, &ledger);
|
||||
}
|
||||
|
||||
/// Remove any unlocked chunks from the `unlocking` queue from our management.
|
||||
///
|
||||
/// This essentially frees up that balance to be used by the stash account to do
|
||||
@@ -1256,6 +1236,26 @@ decl_module! {
|
||||
|
||||
<Self as Store>::UnappliedSlashes::insert(&era, &unapplied);
|
||||
}
|
||||
|
||||
/// Rebond a portion of the stash scheduled to be unlocked.
|
||||
///
|
||||
/// # <weight>
|
||||
/// - Time complexity: O(1). Bounded by `MAX_UNLOCKING_CHUNKS`.
|
||||
/// - Storage changes: Can't increase storage, only decrease it.
|
||||
/// # </weight>
|
||||
#[weight = SimpleDispatchInfo::FixedNormal(500_000)]
|
||||
fn rebond(origin, #[compact] value: BalanceOf<T>) {
|
||||
let controller = ensure_signed(origin)?;
|
||||
let ledger = Self::ledger(&controller).ok_or(Error::<T>::NotController)?;
|
||||
ensure!(
|
||||
ledger.unlocking.len() > 0,
|
||||
Error::<T>::NoUnlockChunk,
|
||||
);
|
||||
|
||||
let ledger = ledger.rebond(value);
|
||||
|
||||
Self::update_ledger(&controller, &ledger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user