mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 11:01:01 +00:00
* fix migrations
* use society versioned runtime upgrade
* simplify usage of versionedruntimeupgrade
* use society experimental feature
* improve usage of experimental flag
* doc comment
* Merge branch 'master' of github.com:paritytech/polkadot into liam-fix-migrations
* Revert "Merge branch 'master' of github.com:paritytech/polkadot into liam-fix-migrations"
This reverts commit 41ab0621811ead11b0a7f91338b0895208feef77.
* doc comment
* westend experimental feature
* Revert "westend experimental feature"
This reverts commit 42f4f1b76655ef509a92c324d18d635a1b913dcb.
* feature gate experimental xcm migration
* update lockfile for {"substrate"}
---------
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -26,8 +26,13 @@ const DEFAULT_PROOF_SIZE: u64 = 64 * 1024;
|
||||
pub mod v1 {
|
||||
use super::*;
|
||||
|
||||
pub struct MigrateToV1<T>(sp_std::marker::PhantomData<T>);
|
||||
impl<T: Config> OnRuntimeUpgrade for MigrateToV1<T> {
|
||||
/// Named with the 'VersionUnchecked'-prefix because although this implements some version
|
||||
/// checking, the version checking is not complete as it will begin failing after the upgrade is
|
||||
/// enacted on-chain.
|
||||
///
|
||||
/// Use experimental [`VersionCheckedMigrateToV1`] instead.
|
||||
pub struct VersionUncheckedMigrateToV1<T>(sp_std::marker::PhantomData<T>);
|
||||
impl<T: Config> OnRuntimeUpgrade for VersionUncheckedMigrateToV1<T> {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<sp_std::vec::Vec<u8>, sp_runtime::TryRuntimeError> {
|
||||
ensure!(StorageVersion::get::<Pallet<T>>() == 0, "must upgrade linearly");
|
||||
@@ -58,4 +63,17 @@ pub mod v1 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Version checked migration to v1.
|
||||
///
|
||||
/// Wrapped in VersionedRuntimeUpgrade so the pre/post checks don't begin failing after the
|
||||
/// upgrade is enacted on-chain.
|
||||
#[cfg(feature = "experimental")]
|
||||
pub type VersionCheckedMigrateToV1<T> = frame_support::migrations::VersionedRuntimeUpgrade<
|
||||
0,
|
||||
1,
|
||||
VersionUncheckedMigrateToV1<T>,
|
||||
crate::pallet::Pallet<T>,
|
||||
<T as frame_system::Config>::DbWeight,
|
||||
>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user