diff --git a/crates/pallet-balanced-currency-swap-bridges-initializer/src/lib.rs b/crates/pallet-balanced-currency-swap-bridges-initializer/src/lib.rs index 3367ff3c0..9bfb210c6 100644 --- a/crates/pallet-balanced-currency-swap-bridges-initializer/src/lib.rs +++ b/crates/pallet-balanced-currency-swap-bridges-initializer/src/lib.rs @@ -113,16 +113,9 @@ pub mod pallet { pub type LastForceRebalanceAskCounter<T: Config> = StorageValue<_, u16, ValueQuery>; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig<T: Config>(PhantomData<T>); - // The default value for the genesis config type. - #[cfg(feature = "std")] - impl<T: Config> Default for GenesisConfig<T> { - fn default() -> Self { - Self(PhantomData) - } - } - // The build of genesis for the pallet. #[pallet::genesis_build] impl<T: Config> GenesisBuild<T> for GenesisConfig<T> { diff --git a/crates/pallet-bioauth/src/lib.rs b/crates/pallet-bioauth/src/lib.rs index eb3662dde..c2282188b 100644 --- a/crates/pallet-bioauth/src/lib.rs +++ b/crates/pallet-bioauth/src/lib.rs @@ -298,6 +298,7 @@ pub mod pallet { >; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig<T: Config> { pub robonode_public_key: T::RobonodePublicKey, pub consumed_auth_ticket_nonces: BoundedVec<BoundedAuthTicketNonce, T::MaxNonces>, @@ -305,18 +306,6 @@ pub mod pallet { BoundedVec<Authentication<T::ValidatorPublicKey, T::Moment>, T::MaxAuthentications>, } - // The default value for the genesis config type. - #[cfg(feature = "std")] - impl<T: Config> Default for GenesisConfig<T> { - fn default() -> Self { - Self { - robonode_public_key: Default::default(), - consumed_auth_ticket_nonces: Default::default(), - active_authentications: Default::default(), - } - } - } - // The build of genesis for the pallet. #[pallet::genesis_build] impl<T: Config> GenesisBuild<T> for GenesisConfig<T> { diff --git a/crates/pallet-bootnodes/src/lib.rs b/crates/pallet-bootnodes/src/lib.rs index 91609c14a..4c239ab6e 100644 --- a/crates/pallet-bootnodes/src/lib.rs +++ b/crates/pallet-bootnodes/src/lib.rs @@ -38,21 +38,12 @@ pub mod pallet { StorageValue<_, BoundedVec<T::BootnodeId, T::MaxBootnodes>, ValueQuery>; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig<T: Config> { /// The list of bootnodes to use. pub bootnodes: BoundedVec<T::BootnodeId, T::MaxBootnodes>, } - // The default value for the genesis config type. - #[cfg(feature = "std")] - impl<T: Config> Default for GenesisConfig<T> { - fn default() -> Self { - Self { - bootnodes: Default::default(), - } - } - } - // The build of genesis for the pallet. #[pallet::genesis_build] impl<T: Config> GenesisBuild<T> for GenesisConfig<T> { diff --git a/crates/pallet-evm-accounts-mapping/src/lib.rs b/crates/pallet-evm-accounts-mapping/src/lib.rs index 022eb9222..ec989d167 100644 --- a/crates/pallet-evm-accounts-mapping/src/lib.rs +++ b/crates/pallet-evm-accounts-mapping/src/lib.rs @@ -2,7 +2,7 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::pallet_prelude::*; +use frame_support::{inherent::Vec, pallet_prelude::*}; use frame_system::pallet_prelude::*; pub use pallet::*; use primitives_ethereum::{EcdsaSignature, EthereumAddress}; @@ -92,21 +92,12 @@ pub mod pallet { pub struct Pallet<T>(_); #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig<T: Config> { /// The mappings to set at genesis. pub mappings: Vec<(T::AccountId, EthereumAddress)>, } - // The default value for the genesis config type. - #[cfg(feature = "std")] - impl<T: Config> Default for GenesisConfig<T> { - fn default() -> Self { - Self { - mappings: Default::default(), - } - } - } - #[pallet::genesis_build] impl<T: Config> GenesisBuild<T> for GenesisConfig<T> { fn build(&self) { diff --git a/crates/pallet-pot/src/lib.rs b/crates/pallet-pot/src/lib.rs index 486738446..92adbcb92 100644 --- a/crates/pallet-pot/src/lib.rs +++ b/crates/pallet-pot/src/lib.rs @@ -33,8 +33,8 @@ pub type NegativeImbalanceOf<T, I = ()> = pub type CreditOf<T, I = ()> = Credit<<T as Config<I>>::AccountId, <T as Config<I>>::Currency>; /// The initial state of the pot, for use in genesis. -#[cfg(feature = "std")] -#[derive(Debug, serde::Serialize, serde::Deserialize)] +#[derive(Debug)] +#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub enum InitialState<Balance> { /// The state of the pot account is not checked at genesis. Unchecked, @@ -117,7 +117,6 @@ pub mod pallet { pub initial_state: InitialState<BalanceOf<T, I>>, } - #[cfg(feature = "std")] impl<T: Config<I>, I: 'static> Default for GenesisConfig<T, I> { fn default() -> Self { Self { diff --git a/crates/pallet-token-claims/src/lib.rs b/crates/pallet-token-claims/src/lib.rs index db93c99af..5c4273dea 100644 --- a/crates/pallet-token-claims/src/lib.rs +++ b/crates/pallet-token-claims/src/lib.rs @@ -9,7 +9,10 @@ #![cfg_attr(not(feature = "std"), no_std)] -use frame_support::traits::{Currency, StorageVersion}; +use frame_support::{ + inherent::Vec, + traits::{Currency, StorageVersion}, +}; pub use weights::*; pub use self::pallet::*; @@ -105,6 +108,7 @@ pub mod pallet { pub type TotalClaimable<T> = StorageValue<_, BalanceOf<T>, ValueQuery>; #[pallet::genesis_config] + #[derive(frame_support::DefaultNoBound)] pub struct GenesisConfig<T: Config> { /// The claims to initialize at genesis. pub claims: Vec<(EthereumAddress, ClaimInfoOf<T>)>, @@ -115,16 +119,6 @@ pub mod pallet { pub total_claimable: Option<BalanceOf<T>>, } - #[cfg(feature = "std")] - impl<T: Config> Default for GenesisConfig<T> { - fn default() -> Self { - GenesisConfig { - claims: Default::default(), - total_claimable: None, - } - } - } - #[pallet::genesis_build] impl<T: Config> GenesisBuild<T> for GenesisConfig<T> { fn build(&self) {