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

Commit

Permalink
add docs for dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Oct 28, 2022
1 parent e765c42 commit 755a62c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
14 changes: 14 additions & 0 deletions frame/support/procedural/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,20 @@ pub fn construct_runtime(input: TokenStream) -> TokenStream {
/// pallet. Otherwise it implements `StorageInfoTrait` for the pallet using the
/// `PartialStorageInfoTrait` implementation of storages.
///
/// ## Dev Mode (`#[pallet::pallet(dev_mode)]`)
///
/// Specifying the argument `dev_mode` will allow you to enable dev mode for a pallet. The aim
/// of dev mode is to loosen some of the restrictions and requirements placed on production
/// pallets for easy tinkering and development. Dev mode pallets should not be used in
/// production. Enabling dev mode has the following effects:
///
/// * Weights no longer need to be specified on every `#[pallet::call]` declaration. By default, dev
/// mode pallets will assume a weight of zero (`0`) if a weight is not specified. This is
/// equivalent to specifying `#[weight(0)]` on all calls that do not specify a weight.
/// * All storages are marked as unbounded, meaning you do not need to implement `MaxEncodedLen` on
/// storage types. This is equivalent to specifying `#[pallet::unbounded]` on all storage type
/// definitions.
///
/// See `frame_support::pallet` docs for more info.
#[proc_macro_attribute]
pub fn pallet(attr: TokenStream, item: TokenStream) -> TokenStream {
Expand Down
15 changes: 15 additions & 0 deletions frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1487,6 +1487,21 @@ pub mod pallet_prelude {
/// non-instantiable pallets. For an example of an instantiable pallet, see [this
/// example](#example-of-an-instantiable-pallet).
///
/// # Dev Mode (`#[pallet::pallet(dev_mode)]`)
///
/// Specifying the argument `dev_mode` will allow you to enable dev mode for a pallet. The aim
/// of dev mode is to loosen some of the restrictions and requirements placed on production
/// pallets for easy tinkering and development. Dev mode pallets should not be used in
/// production. Enabling dev mode has the following effects:
///
/// * Weights no longer need to be specified on every `#[pallet::call]` declaration. By
/// default, dev mode pallets will assume a weight of zero (`0`) if a weight is not
/// specified. This is equivalent to specifying `#[weight(0)]` on all calls that do not
/// specify a weight.
/// * All storages are marked as unbounded, meaning you do not need to implement
/// `MaxEncodedLen` on storage types. This is equivalent to specifying `#[pallet::unbounded]`
/// on all storage type definitions.
///
/// # Pallet struct placeholder: `#[pallet::pallet]` (mandatory)
///
/// The pallet struct placeholder `#[pallet::pallet]` is mandatory and allows you to specify
Expand Down

0 comments on commit 755a62c

Please sign in to comment.