mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-30 23:37:56 +00:00
Warn on missing pallet::call_index (#12894)
* Warn on missing call_index Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Suppress camel case warning Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Simplify code Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Disallow warnings in pallet-ui tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Add pallet UI test Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update Pallet UI Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Use module instead of function Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Update pallet-ui Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
This commit is contained in:
committed by
GitHub
parent
619714243b
commit
9ac1bbe402
@@ -59,6 +59,8 @@ pub struct CallVariantDef {
|
||||
pub weight: syn::Expr,
|
||||
/// Call index of the dispatchable.
|
||||
pub call_index: u8,
|
||||
/// Whether an explicit call index was specified.
|
||||
pub explicit_call_index: bool,
|
||||
/// Docs, used for metadata.
|
||||
pub docs: Vec<syn::Lit>,
|
||||
/// Attributes annotated at the top of the dispatchable function.
|
||||
@@ -243,6 +245,7 @@ impl CallDef {
|
||||
FunctionAttr::CallIndex(idx) => idx,
|
||||
_ => unreachable!("checked during creation of the let binding"),
|
||||
});
|
||||
let explicit_call_index = call_index.is_some();
|
||||
|
||||
let final_index = match call_index {
|
||||
Some(i) => i,
|
||||
@@ -296,6 +299,7 @@ impl CallDef {
|
||||
name: method.sig.ident.clone(),
|
||||
weight,
|
||||
call_index: final_index,
|
||||
explicit_call_index,
|
||||
args,
|
||||
docs,
|
||||
attrs: method.attrs.clone(),
|
||||
|
||||
Reference in New Issue
Block a user