diff --git a/cumulus/pallets/collator-selection/src/lib.rs b/cumulus/pallets/collator-selection/src/lib.rs index 05f9db98c13033aa2da3af3ab7c31a321670e738..3dba6846cc30297486d03902300ca8cd07defcca 100644 --- a/cumulus/pallets/collator-selection/src/lib.rs +++ b/cumulus/pallets/collator-selection/src/lib.rs @@ -165,7 +165,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet<T>(_); /// The invulnerable, fixed collators. diff --git a/cumulus/pallets/dmp-queue/src/lib.rs b/cumulus/pallets/dmp-queue/src/lib.rs index cc4fd4e5719293ce6c2ba0a5a406ccea447d0dd3..6512bb94811fd2b91872a2ebd642e6355344acfc 100644 --- a/cumulus/pallets/dmp-queue/src/lib.rs +++ b/cumulus/pallets/dmp-queue/src/lib.rs @@ -90,7 +90,6 @@ pub mod pallet { use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::storage_version(migration::STORAGE_VERSION)] #[pallet::without_storage_info] pub struct Pallet<T>(_); diff --git a/cumulus/pallets/dmp-queue/src/migration.rs b/cumulus/pallets/dmp-queue/src/migration.rs index 82c1e8b6eb174505756bed34113baed1dc963ec6..b360f5a7bd4e9b1720f852c68bea304dc3a1b12d 100644 --- a/cumulus/pallets/dmp-queue/src/migration.rs +++ b/cumulus/pallets/dmp-queue/src/migration.rs @@ -16,7 +16,7 @@ //! A module that is responsible for migration of storage. -use crate::{Config, Pallet, Store, DEFAULT_POV_SIZE}; +use crate::{Config, Configuration, Overweight, Pallet, DEFAULT_POV_SIZE}; use frame_support::{ pallet_prelude::*, traits::StorageVersion, @@ -74,7 +74,7 @@ pub fn migrate_to_v1<T: Config>() -> Weight { } }; - if let Err(_) = <Pallet<T> as Store>::Configuration::translate(|pre| pre.map(translate)) { + if let Err(_) = Configuration::<T>::translate(|pre| pre.map(translate)) { log::error!( target: "dmp_queue", "unexpected error when performing translation of the QueueConfig type during storage upgrade to v2" @@ -89,7 +89,7 @@ pub fn migrate_to_v1<T: Config>() -> Weight { /// NOTE: Only use this function if you know what you're doing. Default to using /// `migrate_to_latest`. pub fn migrate_to_v2<T: Config>() -> Weight { - let overweight_messages = <Pallet<T> as Store>::Overweight::initialize_counter() as u64; + let overweight_messages = Overweight::<T>::initialize_counter() as u64; T::DbWeight::get().reads_writes(overweight_messages, 1) } diff --git a/cumulus/pallets/parachain-system/src/lib.rs b/cumulus/pallets/parachain-system/src/lib.rs index 587d9051eafa6d435137122133a0ffea97ffecc6..97c6cfe368dbf53aa22a89b267d575c133398ab1 100644 --- a/cumulus/pallets/parachain-system/src/lib.rs +++ b/cumulus/pallets/parachain-system/src/lib.rs @@ -158,7 +158,6 @@ pub mod pallet { #[pallet::pallet] #[pallet::storage_version(migration::STORAGE_VERSION)] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] pub struct Pallet<T>(_); diff --git a/cumulus/pallets/parachain-system/src/migration.rs b/cumulus/pallets/parachain-system/src/migration.rs index 514675b89ac9bfe4f768e82d5eb044362fd3ba94..e3d1e11a51b00b3f8fd3af76f32e57cf9ecc65d2 100644 --- a/cumulus/pallets/parachain-system/src/migration.rs +++ b/cumulus/pallets/parachain-system/src/migration.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU General Public License // along with Cumulus. If not, see <http://www.gnu.org/licenses/>. -use crate::{Config, Pallet, Store}; +use crate::{Config, Pallet, ReservedDmpWeightOverride, ReservedXcmpWeightOverride}; use frame_support::{ traits::{Get, StorageVersion}, weights::Weight, @@ -52,18 +52,14 @@ mod v2 { pub fn migrate<T: Config>() -> Weight { let translate = |pre: u64| -> Weight { Weight::from_parts(pre, DEFAULT_POV_SIZE) }; - if <Pallet<T> as Store>::ReservedXcmpWeightOverride::translate(|pre| pre.map(translate)) - .is_err() - { + if ReservedXcmpWeightOverride::<T>::translate(|pre| pre.map(translate)).is_err() { log::error!( target: "parachain_system", "unexpected error when performing translation of the ReservedXcmpWeightOverride type during storage upgrade to v2" ); } - if <Pallet<T> as Store>::ReservedDmpWeightOverride::translate(|pre| pre.map(translate)) - .is_err() - { + if ReservedDmpWeightOverride::<T>::translate(|pre| pre.map(translate)).is_err() { log::error!( target: "parachain_system", "unexpected error when performing translation of the ReservedDmpWeightOverride type during storage upgrade to v2" diff --git a/cumulus/pallets/solo-to-para/src/lib.rs b/cumulus/pallets/solo-to-para/src/lib.rs index 56b4ef4b4dc895355c318a5fba9c8d9e325b8a7b..515dd385e7b64a0743cf3f8d8d7ed9065149755c 100644 --- a/cumulus/pallets/solo-to-para/src/lib.rs +++ b/cumulus/pallets/solo-to-para/src/lib.rs @@ -35,7 +35,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::without_storage_info] pub struct Pallet<T>(_); diff --git a/cumulus/pallets/xcm/src/lib.rs b/cumulus/pallets/xcm/src/lib.rs index 1bcfcdcce73680d389d0e3dd49ecf74d4e037fcc..f230ced5dc5581eb0e2573676391c99aa5e575da 100644 --- a/cumulus/pallets/xcm/src/lib.rs +++ b/cumulus/pallets/xcm/src/lib.rs @@ -41,7 +41,6 @@ pub mod pallet { use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet<T>(_); /// The module configuration trait. diff --git a/cumulus/pallets/xcmp-queue/src/lib.rs b/cumulus/pallets/xcmp-queue/src/lib.rs index 5a74544d5f258852b93b103b1681e7938efefe77..df2b78ebc20bfea4842580981c2a901e6b01c6d4 100644 --- a/cumulus/pallets/xcmp-queue/src/lib.rs +++ b/cumulus/pallets/xcmp-queue/src/lib.rs @@ -79,7 +79,6 @@ pub mod pallet { use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] #[pallet::storage_version(migration::STORAGE_VERSION)] #[pallet::without_storage_info] pub struct Pallet<T>(_); @@ -763,13 +762,13 @@ impl<T: Config> Pallet<T> { sent_at: RelayBlockNumber, xcm: Vec<u8>, ) -> OverweightIndex { - let index = <Self as Store>::OverweightCount::mutate(|count| { + let index = OverweightCount::<T>::mutate(|count| { let index = *count; *count += 1; index }); - <Self as Store>::Overweight::insert(index, (sender, sent_at, xcm)); + Overweight::<T>::insert(index, (sender, sent_at, xcm)); index } diff --git a/cumulus/pallets/xcmp-queue/src/migration.rs b/cumulus/pallets/xcmp-queue/src/migration.rs index 2dc3a8c3e239691ce9c237769f0d2e56558dc532..f6ece1da1a849a9feedb60f84e48ee737f5e49d7 100644 --- a/cumulus/pallets/xcmp-queue/src/migration.rs +++ b/cumulus/pallets/xcmp-queue/src/migration.rs @@ -16,7 +16,7 @@ //! A module that is responsible for migration of storage. -use crate::{Config, Pallet, Store, DEFAULT_POV_SIZE}; +use crate::{Config, Overweight, Pallet, QueueConfig, DEFAULT_POV_SIZE}; use frame_support::{ pallet_prelude::*, traits::StorageVersion, @@ -94,7 +94,7 @@ pub fn migrate_to_v2<T: Config>() -> Weight { } }; - if let Err(_) = <Pallet<T> as Store>::QueueConfig::translate(|pre| pre.map(translate)) { + if let Err(_) = QueueConfig::<T>::translate(|pre| pre.map(translate)) { log::error!( target: super::LOG_TARGET, "unexpected error when performing translation of the QueueConfig type during storage upgrade to v2" @@ -105,7 +105,7 @@ pub fn migrate_to_v2<T: Config>() -> Weight { } pub fn migrate_to_v3<T: Config>() -> Weight { - let overweight_messages = <Pallet<T> as Store>::Overweight::initialize_counter() as u64; + let overweight_messages = Overweight::<T>::initialize_counter() as u64; T::DbWeight::get().reads_writes(overweight_messages, 1) } diff --git a/cumulus/parachain-template/pallets/template/src/lib.rs b/cumulus/parachain-template/pallets/template/src/lib.rs index 11ef8d4e96b0e54940ac88ba11fe1d08aa3f9c84..5f3252bfc3a70aa731bf572493a3797bfef574bb 100644 --- a/cumulus/parachain-template/pallets/template/src/lib.rs +++ b/cumulus/parachain-template/pallets/template/src/lib.rs @@ -27,7 +27,6 @@ pub mod pallet { } #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet<T>(_); // The pallet's runtime storage items. diff --git a/cumulus/parachains/pallets/parachain-info/src/lib.rs b/cumulus/parachains/pallets/parachain-info/src/lib.rs index 9cb20c9f1e60da20c5687f3ebae980d07658f5ee..d61387aaeb679441cec1e5c710d468e2a2ed566a 100644 --- a/cumulus/parachains/pallets/parachain-info/src/lib.rs +++ b/cumulus/parachains/pallets/parachain-info/src/lib.rs @@ -27,7 +27,6 @@ pub mod pallet { use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet<T>(_); #[pallet::config] diff --git a/cumulus/parachains/pallets/ping/src/lib.rs b/cumulus/parachains/pallets/ping/src/lib.rs index 2c9e5a40aff331a55ed2539058c4920698cf1939..956457f59161d93732f3995fa1687ead39bc9c75 100644 --- a/cumulus/parachains/pallets/ping/src/lib.rs +++ b/cumulus/parachains/pallets/ping/src/lib.rs @@ -40,7 +40,6 @@ pub mod pallet { use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet<T>(_); /// The module configuration trait. diff --git a/cumulus/test/runtime/src/test_pallet.rs b/cumulus/test/runtime/src/test_pallet.rs index 59b82bd256e5b70b8b4bacff60883e792c6f6568..bc72ef19505de429bb78fbe3d19551719b890c6d 100644 --- a/cumulus/test/runtime/src/test_pallet.rs +++ b/cumulus/test/runtime/src/test_pallet.rs @@ -23,7 +23,6 @@ pub mod pallet { use frame_system::pallet_prelude::*; #[pallet::pallet] - #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet<T>(_); #[pallet::config]