allow to write pre and post runtime upgrade in pallet macro (#8194)

This commit is contained in:
Guillaume Thiolliere
2021-02-25 11:43:48 +01:00
committed by GitHub
parent f0c3656489
commit 5232e8ad5c
48 changed files with 136 additions and 6 deletions
+20
View File
@@ -1334,6 +1334,16 @@ macro_rules! decl_module {
result.saturating_add(additional_write)
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
Ok(())
}
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
Ok(())
}
}
};
@@ -1356,6 +1366,16 @@ macro_rules! decl_module {
<$trait_instance as $system::Config>::DbWeight as $crate::traits::Get<_>
>::get().writes(1)
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
Ok(())
}
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
Ok(())
}
}
};