Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

add pallet macro kitchensink example/template #14052

Merged
merged 21 commits into from
Jun 6, 2023

Conversation

kianenigma
Copy link
Contributor

@kianenigma kianenigma commented May 1, 2023

This PR adds a new pallet that is a kitchensink ie gallery of all #[pallet::xxx] macros and how to use them.

It is part of paritytech/polkadot-sdk#186. paritytech/polkadot-sdk#176 was mostly produced using this pallet.

It goes hand in hand with #13987 which will try and make sure they are all documented as best as possible.

}
);

/// Using a default config for [`frame_system`] in tests. See `default-config` example for more
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perhaps it is worth bringing this in as a dependency for linking purposes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean to add the default-config example as a dependency in the kitchensink example?

Copy link
Member

Choose a reason for hiding this comment

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

Tests are not documented AFAIK.

@gupnik gupnik added A0-please_review Pull request needs code review. C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit B1-note_worthy Changes should be noted in the release notes T1-runtime This PR/Issue is related to the topic “runtime”. labels Jun 3, 2023
@gupnik gupnik marked this pull request as ready for review June 3, 2023 05:06
@gupnik gupnik requested review from a team June 3, 2023 05:06
@gupnik
Copy link
Contributor

gupnik commented Jun 3, 2023

bot fmt

@command-bot
Copy link

command-bot bot commented Jun 3, 2023

@gupnik https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2938644 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 63-1a852f2f-eff6-4f45-b8d1-0450d04febe3 to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jun 3, 2023

@gupnik Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2938644 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2938644/artifacts/download.

}
}

#[pallet::composite_enum]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not everything is documented evenly in this crate.

I actually think this crate should not document all pallet macros, but should only provide a very high level intro, and instead make sure when you hover over each pallet macro, the documentation is excellent.

I have already started this for storage macros in #13987. You can follow the same path.

Copy link
Contributor Author

@kianenigma kianenigma left a comment

Choose a reason for hiding this comment

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

There are some little details missing, but overall looks good 👍

gupnik and others added 7 commits June 6, 2023 10:40
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
@gupnik
Copy link
Contributor

gupnik commented Jun 6, 2023

bot fmt

@command-bot
Copy link

command-bot bot commented Jun 6, 2023

@gupnik https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2949499 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 1-ca6d5026-67ac-40b7-be5c-cf6f6466ffca to cancel this command or bot cancel to cancel all commands in this pull request.

@command-bot
Copy link

command-bot bot commented Jun 6, 2023

@gupnik Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2949499 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/2949499/artifacts/download.

@gupnik
Copy link
Contributor

gupnik commented Jun 6, 2023

bot merge

@paritytech-processbot paritytech-processbot bot merged commit 55bb629 into master Jun 6, 2023
@paritytech-processbot paritytech-processbot bot deleted the kiz-pallet-kitchensink branch June 6, 2023 13:47
agryaznov pushed a commit that referenced this pull request Jun 9, 2023
* add pallet macro kitchen-sink pallet

* update

* Adds benchmarking setup

* Updates APIs

* Fixes benchmark

* Uses derive_impl for frame_system

* Adds benchmarks

* Minor update

* Adds license

* Adds examples crate

* ".git/.scripts/commands/fmt/fmt.sh"

* Update frame/examples/kitchensink/src/tests.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/examples/kitchensink/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/examples/kitchensink/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Addresses review comments

* Addresses review comments

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Nikhil Gupta <17176722+gupnik@users.noreply.github.com>
Co-authored-by: command-bot <>
Co-authored-by: command-bot <ci@gitlab.parity.io>
nathanwhit pushed a commit to nathanwhit/substrate that referenced this pull request Jul 19, 2023
* add pallet macro kitchen-sink pallet

* update

* Adds benchmarking setup

* Updates APIs

* Fixes benchmark

* Uses derive_impl for frame_system

* Adds benchmarks

* Minor update

* Adds license

* Adds examples crate

* ".git/.scripts/commands/fmt/fmt.sh"

* Update frame/examples/kitchensink/src/tests.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/examples/kitchensink/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Update frame/examples/kitchensink/src/lib.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Addresses review comments

* Addresses review comments

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Nikhil Gupta <17176722+gupnik@users.noreply.github.com>
Co-authored-by: command-bot <>
Co-authored-by: command-bot <ci@gitlab.parity.io>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B1-note_worthy Changes should be noted in the release notes C1-low PR touches the given topic and has a low impact on builders. D3-trivial 🧸 PR contains trivial changes in a runtime directory that do not require an audit T1-runtime This PR/Issue is related to the topic “runtime”.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

4 participants