mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 19:21:13 +00:00
allow to write pre and post runtime upgrade in pallet macro (#8194)
This commit is contained in:
committed by
GitHub
parent
f0c3656489
commit
5232e8ad5c
@@ -75,6 +75,24 @@ pub fn expand_hooks(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
|
||||
result.saturating_add(additional_write)
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<(), &'static str> {
|
||||
<
|
||||
Self
|
||||
as
|
||||
#frame_support::traits::Hooks<<T as #frame_system::Config>::BlockNumber>
|
||||
>::pre_upgrade()
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade() -> Result<(), &'static str> {
|
||||
<
|
||||
Self
|
||||
as
|
||||
#frame_support::traits::Hooks<<T as #frame_system::Config>::BlockNumber>
|
||||
>::post_upgrade()
|
||||
}
|
||||
}
|
||||
|
||||
impl<#type_impl_gen>
|
||||
|
||||
Reference in New Issue
Block a user