Skip to content

Commit

Permalink
Update Pallet placeholder struct as per FRAME v2 (paritytech#14348)
Browse files Browse the repository at this point in the history
* Update Pallet placeholder struct as per FRAME v3

* ".git/.scripts/commands/fmt/fmt.sh"

* Update lib.rs

Removed the unused import

---------

Co-authored-by: command-bot <>
  • Loading branch information
abhi3700 committed Jun 12, 2023
1 parent 01a3470 commit 85415fb
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion frame/asset-conversion/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub mod pallet {
use sp_std::prelude::*;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
Expand Down
2 changes: 1 addition & 1 deletion frame/atomic-swap/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ pub mod pallet {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::storage]
pub type PendingSwaps<T: Config> = StorageDoubleMap<
Expand Down
2 changes: 1 addition & 1 deletion frame/beefy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ pub mod pallet {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

/// The current authorities set
#[pallet::storage]
Expand Down
2 changes: 1 addition & 1 deletion frame/benchmarking/pov/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub mod pallet {
use sp_std::prelude::*;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
Expand Down
2 changes: 1 addition & 1 deletion frame/benchmarking/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ mod pallet_test {
use frame_system::pallet_prelude::*;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
Expand Down
4 changes: 2 additions & 2 deletions frame/contracts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ use pallet_contracts_primitives::{
use scale_info::TypeInfo;
use smallvec::Array;
use sp_runtime::traits::{Convert, Hash, Saturating, StaticLookup, Zero};
use sp_std::{fmt::Debug, marker::PhantomData, prelude::*};
use sp_std::{fmt::Debug, prelude::*};

pub use crate::{
address::{AddressGenerator, DefaultAddressGenerator},
Expand Down Expand Up @@ -191,7 +191,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
Expand Down
2 changes: 1 addition & 1 deletion frame/election-provider-multi-phase/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1343,7 +1343,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::without_storage_info]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);
}

impl<T: Config> Pallet<T> {
Expand Down
2 changes: 1 addition & 1 deletion frame/elections-phragmen/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ pub mod pallet {
#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
Expand Down
2 changes: 1 addition & 1 deletion frame/indices/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ pub mod pallet {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::call]
impl<T: Config> Pallet<T> {
Expand Down
2 changes: 1 addition & 1 deletion frame/nft-fractionalization/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ pub mod pallet {
use sp_std::{fmt::Display, prelude::*};

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {
Expand Down
2 changes: 1 addition & 1 deletion frame/preimage/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
Expand Down
2 changes: 1 addition & 1 deletion frame/scheduler/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub mod logger {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {}
Expand Down
4 changes: 2 additions & 2 deletions frame/sudo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
//! use frame_system::pallet_prelude::*;
//!
//! #[pallet::pallet]
//! pub struct Pallet<T>(PhantomData<T>);
//! pub struct Pallet<T>(_);
//!
//! #[pallet::config]
//! pub trait Config: frame_system::Config {}
Expand Down Expand Up @@ -141,7 +141,7 @@ pub mod pallet {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::call]
impl<T: Config> Pallet<T> {
Expand Down
2 changes: 1 addition & 1 deletion frame/sudo/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pub mod logger {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::call]
impl<T: Config> Pallet<T> {
Expand Down
2 changes: 1 addition & 1 deletion frame/support/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3582,7 +3582,7 @@ mod weight_tests {
use crate::pallet_prelude::*;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
#[pallet::disable_frame_system_supertrait_check]
Expand Down
2 changes: 1 addition & 1 deletion frame/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ pub mod tests {
use crate::pallet_prelude::*;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
#[pallet::disable_frame_system_supertrait_check]
Expand Down
2 changes: 1 addition & 1 deletion frame/support/src/storage/generator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ mod tests {
use crate::pallet_prelude::*;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
#[pallet::disable_frame_system_supertrait_check]
Expand Down
2 changes: 1 addition & 1 deletion frame/support/test/tests/final_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ mod no_instance {
use frame_support_test as frame_system;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {}
Expand Down
2 changes: 1 addition & 1 deletion frame/support/test/tests/genesisconfig.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub mod pallet {
use frame_support_test as frame_system;

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {}
Expand Down
2 changes: 1 addition & 1 deletion frame/support/test/tests/issue2219.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ mod module {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config + TypeInfo {}
Expand Down
2 changes: 1 addition & 1 deletion frame/timestamp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ pub mod pallet {
}

#[pallet::pallet]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

/// Current time for the current block.
#[pallet::storage]
Expand Down
2 changes: 1 addition & 1 deletion test-utils/runtime/src/substrate_test_pallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ pub mod pallet {

#[pallet::pallet]
#[pallet::without_storage_info]
pub struct Pallet<T>(PhantomData<T>);
pub struct Pallet<T>(_);

#[pallet::config]
pub trait Config: frame_system::Config {}
Expand Down
2 changes: 1 addition & 1 deletion utils/frame/rpc/support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ use sp_storage::{StorageData, StorageKey};
/// use frame_support::pallet_prelude::*;
///
/// #[pallet::pallet]
/// pub struct Pallet<T>(PhantomData<T>);
/// pub struct Pallet<T>(_);
///
/// #[pallet::config]
/// pub trait Config: frame_system::Config {}
Expand Down

0 comments on commit 85415fb

Please sign in to comment.