mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 05:17:58 +00:00
Migrate all doc to new pallet macro (#10187)
* Migrate all doc to new pallet macro Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix indent Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix format Signed-off-by: koushiro <koushiro.cqx@gmail.com>
This commit is contained in:
@@ -52,28 +52,27 @@
|
||||
//! This is an example of a pallet that exposes a privileged function:
|
||||
//!
|
||||
//! ```
|
||||
//!
|
||||
//! #[frame_support::pallet]
|
||||
//! pub mod logger {
|
||||
//! pub mod pallet {
|
||||
//! use super::*;
|
||||
//! use frame_support::pallet_prelude::*;
|
||||
//! use frame_system::pallet_prelude::*;
|
||||
//! use super::*;
|
||||
//!
|
||||
//! #[pallet::pallet]
|
||||
//! pub struct Pallet<T>(_);
|
||||
//!
|
||||
//! #[pallet::config]
|
||||
//! pub trait Config: frame_system::Config {}
|
||||
//!
|
||||
//! #[pallet::pallet]
|
||||
//! pub struct Pallet<T>(PhantomData<T>);
|
||||
//!
|
||||
//! #[pallet::call]
|
||||
//! impl<T: Config> Pallet<T> {
|
||||
//! #[pallet::weight(0)]
|
||||
//! pub fn privileged_function(origin: OriginFor<T>) -> DispatchResultWithPostInfo {
|
||||
//! pub fn privileged_function(origin: OriginFor<T>) -> DispatchResult {
|
||||
//! ensure_root(origin)?;
|
||||
//!
|
||||
//! // do something...
|
||||
//!
|
||||
//! Ok(().into())
|
||||
//! Ok(())
|
||||
//! }
|
||||
//! }
|
||||
//! }
|
||||
|
||||
Reference in New Issue
Block a user