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

Finish documenting #[pallet::xxx] macros #2638

Merged
merged 65 commits into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
c7c2e98
fixing links and improving comments
liamaharon Dec 6, 2023
de5e6e2
document crate_to_crate_version
liamaharon Dec 6, 2023
cf3ce88
fix bench links
liamaharon Dec 6, 2023
0abcfea
move error docs to frame_support
liamaharon Dec 6, 2023
b13b793
move event docs to frame support and fix links
liamaharon Dec 6, 2023
00b909c
fix extrinsic call
liamaharon Dec 6, 2023
cf3c9f7
add links to feeless_if macro
liamaharon Dec 6, 2023
e9be90b
fix generate deposit docs
liamaharon Dec 6, 2023
dd3841e
Merge branch 'master' into liam-pallet-macro-docs
liamaharon Dec 7, 2023
0c7d715
".git/.scripts/commands/fmt/fmt.sh"
Dec 7, 2023
fcc5994
fix rustfmt
liamaharon Dec 7, 2023
4a9c9d4
fix hooks docs
liamaharon Dec 7, 2023
3a0e2d5
fix inject_runtime_type doc
liamaharon Dec 7, 2023
5cffe3f
fix links
liamaharon Dec 7, 2023
d2babe6
use latest pallet docs
liamaharon Dec 7, 2023
d499ac1
Merge branch 'master' into liam-pallet-macro-docs
liamaharon Dec 7, 2023
350a4d3
add doc for require transactional
liamaharon Dec 7, 2023
2d64a11
doc storage alias
liamaharon Dec 7, 2023
4b4da8d
storage version doc
liamaharon Dec 7, 2023
db6b68d
type_value doc
liamaharon Dec 7, 2023
7b8ecfb
validate unsigned links
liamaharon Dec 7, 2023
3fa0651
Merge branch 'master' into liam-pallet-macro-docs
liamaharon Dec 7, 2023
4e990d5
Merge branch 'master' into liam-pallet-macro-docs
liamaharon Dec 19, 2023
43ec623
Merge branch 'master' into liam-pallet-macro-docs
liamaharon Jan 18, 2024
3fcbf60
doc tests
liamaharon Feb 26, 2024
98db02f
move composite_enum docs to frame_support
liamaharon Feb 27, 2024
90e5ca6
move pallet::config docs to frame_support
liamaharon Feb 27, 2024
a96119e
move disable_frame_system_supertrait docs to frame_support
liamaharon Feb 27, 2024
c7052c0
move extra_constants docs to frame_system
liamaharon Feb 27, 2024
eaa0559
move generate_store doc to frame_support
liamaharon Feb 27, 2024
a83253e
move getter docs to frame_support
liamaharon Feb 27, 2024
4bd0054
move import_section docs to frame_support
liamaharon Feb 27, 2024
a6902da
move inherent docs to frame_support
liamaharon Feb 27, 2024
6ddb762
move no_default docs to frame_support
liamaharon Feb 27, 2024
b79a7f4
move no_default_bounds docs to frame_support
liamaharon Feb 27, 2024
9eda61c
move origin docs to frame_support
liamaharon Feb 27, 2024
6123c84
move pallet_section docs to frame_support
liamaharon Feb 27, 2024
4ff3cbd
move storage_prefix docs to frame_support
liamaharon Feb 27, 2024
3dbddc1
move unbounded docs to frame_support
liamaharon Feb 27, 2024
d064bae
move pallet::weight docs to frame_support
liamaharon Feb 27, 2024
b5b7dfb
move pallet::whitelist_storage to frame_support
liamaharon Feb 27, 2024
2101166
remove links from proc macro comments
liamaharon Feb 28, 2024
6cb90e0
finish removing links
liamaharon Feb 28, 2024
e2bb8b2
fix comment
liamaharon Feb 28, 2024
6b4362f
fix comment
liamaharon Feb 28, 2024
c3b0f86
remove links
liamaharon Feb 28, 2024
85a3984
fix
liamaharon Feb 28, 2024
0921fa6
Update substrate/frame/support/src/lib.rs
liamaharon Feb 29, 2024
8d39b1a
Update substrate/frame/support/src/lib.rs
liamaharon Feb 29, 2024
3720062
address comments
liamaharon Feb 29, 2024
55d0516
Merge branch 'liam-pallet-macro-docs' of github.com:paritytech/polkad…
liamaharon Feb 29, 2024
b4eb09f
improve doc summary paras and make doctests more concise
liamaharon Feb 29, 2024
4d8a347
unignore failing doctest to not forget about it
liamaharon Feb 29, 2024
a3a73bb
add more backlinks to 'your first pallet' guide
liamaharon Feb 29, 2024
ad57e0e
Merge branch 'master' into liam-pallet-macro-docs
liamaharon Feb 29, 2024
a3d57a4
update cargo.lock
liamaharon Feb 29, 2024
5d05227
fix merge
liamaharon Feb 29, 2024
3dd9bff
disable compiling supertrait example
liamaharon Mar 1, 2024
eef3555
fix merge
liamaharon Mar 1, 2024
a1a2591
fix bad merge
liamaharon Mar 1, 2024
d6a3c32
Update substrate/frame/support/procedural/src/lib.rs
liamaharon Mar 1, 2024
3faf4dc
address comments
liamaharon Mar 3, 2024
44a7021
Merge branch 'master' into liam-pallet-macro-docs
liamaharon Mar 3, 2024
16b9d92
update disable_frame_system_supertrait_check doc
liamaharon Mar 3, 2024
fed90fc
zepter
liamaharon Mar 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 12 additions & 8 deletions docs/sdk/src/guides/your_first_pallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,14 +250,16 @@
// of event is probably not the best.
//!
//! With the explanation out of the way, let's see how these components can be added. Both follow a
//! fairly familiar syntax: normal Rust enums, with an extra `#[frame::event/error]` attribute
//! attached.
//! fairly familiar syntax: normal Rust enums, with extra
//! [`#[frame::event]`](frame::pallet_macros::event) and
//! [`#[frame::error]`](frame::pallet_macros::error) attributes attached.
#![doc = docify::embed!("./src/guides/your_first_pallet/mod.rs", Event)]
#![doc = docify::embed!("./src/guides/your_first_pallet/mod.rs", Error)]
//!
//! One slightly custom part of this is the `#[pallet::generate_deposit(pub(super) fn
//! deposit_event)]` part. Without going into too much detail, in order for a pallet to emit events
//! to the rest of the system, it needs to do two things:
//! One slightly custom part of this is the [`#[pallet::generate_deposit(pub(super) fn
//! deposit_event)]`](frame::pallet_macros::generate_deposit) part. Without going into too
//! much detail, in order for a pallet to emit events to the rest of the system, it needs to do two
//! things:
//!
//! 1. Declare a type in its `Config` that refers to the overarching event type of the runtime. In
//! short, by doing this, the pallet is expressing an important bound: `type RuntimeEvent:
Expand All @@ -266,7 +268,8 @@
//! store it where needed.
//!
//! 2. But, doing this conversion and storing is too much to expect each pallet to define. FRAME
//! provides a default way of storing events, and this is what `pallet::generate_deposit` is doing.
//! provides a default way of storing events, and this is what
//! [`pallet::generate_deposit`](frame::pallet_macros::generate_deposit) is doing.
#![doc = docify::embed!("./src/guides/your_first_pallet/mod.rs", config_v2)]
//!
//! > These `Runtime*` types are better explained in
Expand All @@ -280,8 +283,9 @@
#![doc = docify::embed!("./src/guides/your_first_pallet/mod.rs", runtime_v2)]
//!
//! In this snippet, the actual `RuntimeEvent` type (right hand side of `type RuntimeEvent =
//! RuntimeEvent`) is generated by `construct_runtime`. An interesting way to inspect this type is
//! to see its definition in rust-docs:
//! RuntimeEvent`) is generated by
//! [`construct_runtime`](frame::runtime::prelude::construct_runtime). An interesting way to inspect
//! this type is to see its definition in rust-docs:
//! [`crate::guides::your_first_pallet::pallet_v2::tests::runtime_v2::RuntimeEvent`].
//!
//!
Expand Down
1 change: 1 addition & 0 deletions substrate/frame/support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ aquamarine = { version = "0.5.0" }
[dev-dependencies]
assert_matches = "1.3.0"
pretty_assertions = "1.2.1"
sp-timestamp = { path = "../../primitives/timestamp", default-features = false }
frame-system = { path = "../system" }
sp-crypto-hashing = { path = "../../primitives/crypto/hashing" }

Expand Down
Loading
Loading