Skip to content

Commit

Permalink
migrations succeed
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Jan 23, 2024
1 parent 7f18dea commit ac08cc2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions polkadot-parachains/integritee-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -832,8 +832,8 @@ pub type Migrations = (
// migration changes the pallet name prefix (back in 2021). no need to touch this. I guess this has been left untouched when we migrated solo to para
// for consistency, we will bruteforce to V4
// future: v1.6.0 is still at V4.
migrations_fix::collective::v4::MigrateToV4<Runtime, Instance1>,
migrations_fix::collective::v4::MigrateToV4<Runtime, Instance2>,
migrations_fix::collective::v4::MigrateToV4<Runtime, CouncilInstance>,
migrations_fix::collective::v4::MigrateToV4<Runtime, TechnicalCommitteeInstance>,
);

/// Executive: handles dispatch to the various modules.
Expand Down
8 changes: 4 additions & 4 deletions polkadot-parachains/integritee-runtime/src/migrations_fix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,10 @@ pub mod collective {
use frame_support::{pallet_prelude::*, traits::Instance};
use sp_std::vec::Vec;

pub struct MigrateToV4<T: Config<I>, I: 'static>(sp_std::marker::PhantomData<(T, I)>);
impl<T: Config<I>, I: Instance + 'static> OnRuntimeUpgrade for MigrateToV4<T, I> {
pub struct MigrateToV4<T: Config<I>, I: 'static>(PhantomData<(T, I)>);
impl<T: Config<I>, I: 'static> OnRuntimeUpgrade for MigrateToV4<T, I> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, sp_runtime::DispatchError> {
fn pre_upgrade() -> Result<Vec<u8>, DispatchError> {
Ok((0u32).encode())
}

Expand All @@ -176,7 +176,7 @@ pub mod collective {
}

#[cfg(feature = "try-runtime")]
fn post_upgrade(_state: Vec<u8>) -> Result<(), sp_runtime::DispatchError> {
fn post_upgrade(_state: Vec<u8>) -> Result<(), DispatchError> {
ensure!(StorageVersion::get::<Pallet<T, I>>() == 4, "Must upgrade");
Ok(())
}
Expand Down

0 comments on commit ac08cc2

Please sign in to comment.