mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 02:17:58 +00:00
Enforce pub calls in pallets (#9085)
* make all extrinsics public so they are available from outside * Impl * fix * more fix * more pub * few more * merge fix * fix ui test * fix ui test Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: Bastian Köcher <info@kchr.de>
This commit is contained in:
committed by
GitHub
parent
f21243e4e5
commit
d31e607bda
@@ -149,6 +149,18 @@ impl CallDef {
|
||||
let mut methods = vec![];
|
||||
for impl_item in &mut item.items {
|
||||
if let syn::ImplItem::Method(method) = impl_item {
|
||||
if !matches!(method.vis, syn::Visibility::Public(_)) {
|
||||
let msg = "Invalid pallet::call, dispatchable function must be public: \
|
||||
`pub fn`";
|
||||
|
||||
let span = match method.vis {
|
||||
syn::Visibility::Inherited => method.sig.span(),
|
||||
_ => method.vis.span(),
|
||||
};
|
||||
|
||||
return Err(syn::Error::new(span, msg));
|
||||
}
|
||||
|
||||
match method.sig.inputs.first() {
|
||||
None => {
|
||||
let msg = "Invalid pallet::call, must have at least origin arg";
|
||||
|
||||
Reference in New Issue
Block a user