Skip to content

Commit

Permalink
CI: Disable runtime upgrade spec name check on Westend Asset Hub and …
Browse files Browse the repository at this point in the history
…fix Staking pallet migration (paritytech#2447)

Westend Asset Hub currently failing because the spec name is being
changed next runtime upgrade
(https://gitlab.parity.io/parity/mirrors/polkadot-sdk/-/jobs/4413125).

This also fixes an idempotency issue with a staking pallet migration.
Similar issues will be caught automatically now that we've also updated
to try-runtime-cli v0.5.0 which checks for idempotency issues.

This also enables try-state checks running in the CI.
  • Loading branch information
liamaharon authored Nov 23, 2023
1 parent beeac90 commit a910d12
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions substrate/frame/staking/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,20 +81,10 @@ pub mod v14 {
}
}

#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
frame_support::ensure!(
Pallet::<T>::on_chain_storage_version() == 13,
"Required v13 before upgrading to v14."
);

Ok(Default::default())
}

#[cfg(feature = "try-runtime")]
fn post_upgrade(_state: Vec<u8>) -> Result<(), TryRuntimeError> {
frame_support::ensure!(
Pallet::<T>::on_chain_storage_version() == 14,
Pallet::<T>::on_chain_storage_version() >= 14,
"v14 not applied"
);
Ok(())
Expand Down

0 comments on commit a910d12

Please sign in to comment.