Try-runtime proper return types (#7146)

* Try-runtime proper return types

* update

* oops

* use ensure

* update lockfile for {"substrate"}

---------

Co-authored-by: parity-processbot <>
This commit is contained in:
Sergej Sakac
2023-05-23 09:40:37 +02:00
committed by GitHub
parent 23a737257d
commit 2b6f0b0194
10 changed files with 214 additions and 213 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ pub mod v1 {
pub struct MigrateToV1<T>(sp_std::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV1<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<sp_std::vec::Vec<u8>, &'static str> {
fn pre_upgrade() -> Result<sp_std::vec::Vec<u8>, sp_runtime::TryRuntimeError> {
ensure!(StorageVersion::get::<Pallet<T>>() == 0, "must upgrade linearly");
Ok(sp_std::vec::Vec::new())