mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 09:51:10 +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:
@@ -54,16 +54,24 @@
|
||||
//! ## Usage
|
||||
//!
|
||||
//! ```
|
||||
//! use frame_support::{decl_module, dispatch};
|
||||
//! use frame_system::ensure_signed;
|
||||
//! use pallet_scored_pool::{self as scored_pool};
|
||||
//!
|
||||
//! pub trait Config: scored_pool::Config {}
|
||||
//! #[frame_support::pallet]
|
||||
//! pub mod pallet {
|
||||
//! use super::*;
|
||||
//! use frame_support::pallet_prelude::*;
|
||||
//! use frame_system::pallet_prelude::*;
|
||||
//!
|
||||
//! decl_module! {
|
||||
//! pub struct Module<T: Config> for enum Call where origin: T::Origin {
|
||||
//! #[weight = 0]
|
||||
//! pub fn candidate(origin) -> dispatch::DispatchResult {
|
||||
//! #[pallet::pallet]
|
||||
//! pub struct Pallet<T>(_);
|
||||
//!
|
||||
//! #[pallet::config]
|
||||
//! pub trait Config: frame_system::Config + scored_pool::Config {}
|
||||
//!
|
||||
//! #[pallet::call]
|
||||
//! impl<T: Config> Pallet<T> {
|
||||
//! #[pallet::weight(0)]
|
||||
//! pub fn candidate(origin: OriginFor<T>) -> DispatchResult {
|
||||
//! let who = ensure_signed(origin)?;
|
||||
//!
|
||||
//! let _ = <scored_pool::Pallet<T>>::submit_candidacy(
|
||||
@@ -116,9 +124,8 @@ enum ChangeReceiver {
|
||||
#[frame_support::pallet]
|
||||
pub mod pallet {
|
||||
use super::*;
|
||||
use frame_support::{pallet_prelude::*, traits::EnsureOrigin, weights::Weight};
|
||||
use frame_system::{ensure_root, ensure_signed, pallet_prelude::*};
|
||||
use sp_runtime::traits::MaybeSerializeDeserialize;
|
||||
use frame_support::pallet_prelude::*;
|
||||
use frame_system::pallet_prelude::*;
|
||||
|
||||
#[pallet::pallet]
|
||||
#[pallet::generate_store(pub(super) trait Store)]
|
||||
|
||||
Reference in New Issue
Block a user