mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-11-30 06:19:56 +00:00
Add an INDEX to the Instance trait (#8555)
* Add an index to the Instance trait * Update frame/support/procedural/src/storage/instance_trait.rs
This commit is contained in:
1 parent
1cb3590f49
commit
d8c1a1d12b
5 files changed
+23
-8
No files matched your search
@@ -17,14 +17,15 @@
|
||||
|
||||
use proc_macro2::Span;
|
||||
use crate::pallet::Def;
|
||||
use crate::NUMBER_OF_INSTANCE;
|
||||
|
||||
/// * Provide inherent instance to be used by construct_runtime
|
||||
/// * Provide Instance0 .. Instance16 for instantiable pallet
|
||||
/// * Provide Instance1 ..= Instance16 for instantiable pallet
|
||||
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 {
|
||||
(0..16).map(|i| syn::Ident::new(&format!("Instance{}", i), Span::call_site())).collect()
|
||||
(1..=NUMBER_OF_INSTANCE).map(|i| syn::Ident::new(&format!("Instance{}", i), Span::call_site())).collect()
|
||||
} else {
|
||||
vec![]
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user