Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
liamaharon committed Feb 26, 2024
1 parent 533a665 commit 683ba87
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
21 changes: 17 additions & 4 deletions substrate/frame/support/procedural/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1376,10 +1376,23 @@ pub fn whitelist_storage(_: TokenStream, _: TokenStream) -> TokenStream {
/// attached to transient storage which cannot be migrated during runtime upgrades.
///
/// ### Example
/// ```ignore
/// #[pallet::storage]
/// #[pallet::disable_try_decode_storage]
/// pub(super) type Events<T: Config> = StorageValue<_, Vec<Box<EventRecord<T::RuntimeEvent, T::Hash>>>, ValueQuery>;
/// ```
/// use frame::prelude::*;
///
/// #[frame::pallet(dev_mode)]
/// pub mod pallet {
/// use super::*;
///
/// #[pallet::config]
/// pub trait Config: frame_system::Config {}
///
/// #[pallet::pallet]
/// pub struct Pallet<T>(_);
///
/// #[pallet::storage]
/// #[pallet::disable_try_decode_storage]
/// pub(super) type Events<T: Config> = StorageValue<_, Vec<Box<EventRecord<T::RuntimeEvent, T::Hash>>>, ValueQuery>;
/// }
/// ```
///
/// NOTE: As with all `pallet::*` attributes, this one _must_ be written as
Expand Down
3 changes: 3 additions & 0 deletions substrate/frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2709,6 +2709,8 @@ pub mod pallet_macros {
/// * [`macro@getter`]: Creates a custom getter function.
/// * [`macro@storage_prefix`]: Overrides the default prefix of the storage item.
/// * [`macro@unbounded`]: Declares the storage item as unbounded.
/// * [`macro@disable_try_decode_storage`]: Declares that try-runtime checks should not
/// attempt to decode the storage item.
///
/// #### Example
/// ```
Expand All @@ -2724,6 +2726,7 @@ pub mod pallet_macros {
/// #[pallet::getter(fn foo)]
/// #[pallet::storage_prefix = "OtherFoo"]
/// #[pallet::unbounded]
/// #[pallet::disable_try_decode_storage]
/// pub type Foo<T> = StorageValue<_, u32, ValueQuery>;
/// }
/// ```
Expand Down

0 comments on commit 683ba87

Please sign in to comment.