mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-18 22:15:40 +00:00
Introduce #[pallet::call_index] attribute to dispatchables (#11381)
* Introduce #[pallet::call_index] attribute to dispatchables * cargo fmt * Add more docs and prevent duplicates of call indices * Add UI test for conflicting call indices * cargo fmt Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -42,6 +42,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
let pallet_ident = &def.pallet_struct.pallet;
|
||||
|
||||
let fn_name = methods.iter().map(|method| &method.name).collect::<Vec<_>>();
|
||||
let call_index = methods.iter().map(|method| method.call_index).collect::<Vec<_>>();
|
||||
let new_call_variant_fn_name = fn_name
|
||||
.iter()
|
||||
.map(|fn_name| quote::format_ident!("new_call_variant_{}", fn_name))
|
||||
@@ -177,6 +178,7 @@ pub fn expand_call(def: &mut Def) -> proc_macro2::TokenStream {
|
||||
),
|
||||
#(
|
||||
#( #[doc = #fn_doc] )*
|
||||
#[codec(index = #call_index)]
|
||||
#fn_name {
|
||||
#(
|
||||
#[allow(missing_docs)]
|
||||
|
||||
Reference in New Issue
Block a user