Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Nathy-bajo
Copy link

resolves #7354

@Nathy-bajo Nathy-bajo requested a review from a team as a code owner January 28, 2025 23:28
@gui1117
Copy link
Contributor

gui1117 commented Jan 29, 2025

I think it should be in the doc of call and weight.

@Nathy-bajo
Copy link
Author

I think it should be in the doc of call and weight.

That's what I meant to do

Comment on lines 1115 to 1116
/// # #[pallet::config]
/// # pub trait Config: frame_system::Config {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// # #[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())]
Copy link
Member

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 :)

Copy link
Author

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?

@paritytech-review-bot paritytech-review-bot bot requested a review from a team January 30, 2025 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The specification for #[pallet::call(weight = <T as Config>::WeightInfo)] is not documented
3 participants