Skip to content
Snippets Groups Projects
Commit 1d93746b authored by Gavin Wood's avatar Gavin Wood Committed by GitHub
Browse files

Update locks on upgrade (#6172)

parent ecccf469
Branches
No related merge requests found
......@@ -53,12 +53,11 @@ use codec::{Encode, Decode};
use sp_runtime::{DispatchResult, RuntimeDebug, traits::{
StaticLookup, Zero, AtLeast32Bit, MaybeSerializeDeserialize, Convert
}};
use frame_support::{decl_module, decl_event, decl_storage, decl_error, ensure};
use frame_support::{decl_module, decl_event, decl_storage, decl_error, ensure, IterableStorageMap};
use frame_support::traits::{
Currency, LockableCurrency, VestingSchedule, WithdrawReason, LockIdentifier,
ExistenceRequirement, Get
};
use frame_system::{self as system, ensure_signed};
mod benchmarking;
......@@ -182,6 +181,13 @@ decl_module! {
fn deposit_event() = default;
fn on_runtime_upgrade() -> frame_support::dispatch::Weight {
for (a, _) in Vesting::<T>::iter() {
let _ = Self::update_lock(a);
}
1_000_000_000_000
}
/// Unlock any vested funds of the sender account.
///
/// The dispatch origin for this call must be _Signed_ and the sender must have funds still
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment