use crate::{pallet::Def, NUMBER_OF_INSTANCE};
use proc_macro2::Span;
pub fn expand_instances(def: &mut Def) -> proc_macro2::TokenStream {
let frame_support = &def.frame_support;
let inherent_ident = syn::Ident::new(crate::INHERENT_INSTANCE_NAME, Span::call_site());
let instances = if def.config.has_instance {
(1..=NUMBER_OF_INSTANCE)
.map(|i| syn::Ident::new(&format!("Instance{}", i), Span::call_site()))
.collect()
} else {
vec![]
};
quote::quote!(
#[doc(hidden)]
pub type #inherent_ident = ();
#( pub use #frame_support::instances::#instances; )*
)
}