diff --git a/runtime/common/src/claims.rs b/runtime/common/src/claims.rs index 3c37779cde69..87f469919e46 100644 --- a/runtime/common/src/claims.rs +++ b/runtime/common/src/claims.rs @@ -19,7 +19,7 @@ use sp_std::prelude::*; use sp_io::{hashing::keccak_256, crypto::secp256k1_ecdsa_recover}; use frame_support::{decl_event, decl_storage, decl_module, decl_error}; -use frame_support::weights::SimpleDispatchInfo; +use frame_support::weights::{SimpleDispatchInfo, Weight, WeighData}; use frame_support::traits::{Currency, Get, VestingSchedule}; use system::{ensure_root, ensure_none}; use codec::{Encode, Decode}; @@ -142,6 +142,18 @@ decl_storage! { } } +mod migration { + use super::*; + + pub fn migrate() { + if let Ok(addresses) = Vec::::decode(&mut &include_bytes!("./claims.scale")[..]) { + for i in &addresses { + Claims::::migrate_key_from_blake(i); + } + } + } +} + decl_module! { pub struct Module for enum Call where origin: T::Origin { type Error = Error; @@ -152,6 +164,11 @@ decl_module! { /// Deposit one of this module's events by using the default implementation. fn deposit_event() = default; + fn on_runtime_upgrade() -> Weight { + migration::migrate::(); + SimpleDispatchInfo::default().weigh_data(()) + } + /// Make a claim to collect your DOTs. /// /// The dispatch origin for this call must be _None_. diff --git a/runtime/common/src/claims.scale b/runtime/common/src/claims.scale new file mode 100644 index 000000000000..e079576aca71 Binary files /dev/null and b/runtime/common/src/claims.scale differ diff --git a/runtime/kusama/src/lib.rs b/runtime/kusama/src/lib.rs index d5e28b9c2d59..a192871367d8 100644 --- a/runtime/kusama/src/lib.rs +++ b/runtime/kusama/src/lib.rs @@ -83,8 +83,8 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("kusama"), impl_name: create_runtime_str!("parity-kusama"), authoring_version: 2, - spec_version: 1057, - impl_version: 1, + spec_version: 1058, + impl_version: 0, apis: RUNTIME_API_VERSIONS, };