Pallet proc macro doc improvements (#7955)

* Fix weight syntax in comments

* Mention to add `IsType` bound

* Link to subsee

* Fix link

* Update frame/support/procedural/src/pallet/parse/call.rs

Co-authored-by: David <dvdplm@gmail.com>

* Apply review suggestion from @dvdplm, make StorageInstance doc link

* fix ui test

Co-authored-by: David <dvdplm@gmail.com>
Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Andrew Jones
2021-01-25 17:18:38 +00:00
committed by GitHub
parent ee85121c57
commit 82d9d5adcf
3 changed files with 11 additions and 8 deletions
@@ -57,7 +57,7 @@ pub struct CallVariantDef {
}
/// Attributes for functions in call impl block.
/// Parse for `#[pallet::weight = expr]`
/// Parse for `#[pallet::weight(expr)]`
pub struct FunctionAttr {
weight: syn::Expr,
}
@@ -175,7 +175,7 @@ impl CallDef {
if call_var_attrs.len() != 1 {
let msg = if call_var_attrs.is_empty() {
"Invalid pallet::call, require weight attribute i.e. `#[pallet::weight = $expr]`"
"Invalid pallet::call, requires weight attribute i.e. `#[pallet::weight($expr)]`"
} else {
"Invalid pallet::call, too many weight attributes given"
};