mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
Allow pallet's info to be enumerated (#10053)
* Allow pallet's info to be enumerated * Fixes * Formatting * Flat tuple for getting all pallet instances * Renaming and fixing reversedness * Formatting * Fixes * Back to nesting * Back to nestingx * Revert executive lib * Reversions * Reversions * Fixes * Fixes * Formatting * Fixes * Spelling * Comments
This commit is contained in:
@@ -217,6 +217,7 @@ fn decl_all_pallets<'a>(
|
||||
|
||||
quote!(
|
||||
#types
|
||||
|
||||
/// All pallets included in the runtime as a nested tuple of types.
|
||||
/// Excludes the System pallet.
|
||||
pub type AllPallets = ( #all_pallets );
|
||||
|
||||
@@ -233,6 +233,25 @@ pub fn expand_pallet_struct(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
}
|
||||
}
|
||||
|
||||
impl<#type_impl_gen> #frame_support::traits::PalletsInfoAccess
|
||||
for #pallet_ident<#type_use_gen>
|
||||
#config_where_clause
|
||||
{
|
||||
fn count() -> usize { 1 }
|
||||
fn accumulate(
|
||||
acc: &mut #frame_support::sp_std::vec::Vec<#frame_support::traits::PalletInfoData>
|
||||
) {
|
||||
use #frame_support::traits::PalletInfoAccess;
|
||||
let item = #frame_support::traits::PalletInfoData {
|
||||
index: Self::index(),
|
||||
name: Self::name(),
|
||||
module_name: Self::module_name(),
|
||||
crate_version: Self::crate_version(),
|
||||
};
|
||||
acc.push(item);
|
||||
}
|
||||
}
|
||||
|
||||
#storage_info
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user