-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Documentation update for weight. #7354 #7376
base: master
Are you sure you want to change the base?
Conversation
I think it should be in the doc of |
That's what I meant to do |
substrate/frame/support/src/lib.rs
Outdated
/// # #[pallet::config] | ||
/// # pub trait Config: frame_system::Config { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// # #[pallet::config] | |
/// # pub trait Config: frame_system::Config { | |
/// #[pallet::config] | |
/// pub trait Config: frame_system::Config { |
/// | ||
/// #[pallet::call] | ||
/// impl<T: Config> Pallet<T> { | ||
/// #[pallet::weight({0})] // <- set actual weight here | ||
/// #[pallet::weight(<T as Config>::WeightInfo::do_something())] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue was talking about the following syntax:
#[pallet::weight(<T as Config>::WeightInfo)]
But your example also makes sense! It would be nice if you could include both examples :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already added examples using the #[pallet::weight(<T as Config>::WeightInfo)]
or #[pallet::call(weight = <T as Config>::WeightInfo)]
attribute. which examples do you mean, please?
resolves #7354