From f207c07e539c228e1ed311c2cd1bda4762a3fc91 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Thu, 15 Jun 2023 22:31:31 +0200 Subject: [PATCH 1/3] Delete old weight functions Signed-off-by: Oliver Tale-Yazdi --- primitives/weights/src/weight_v2.rs | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/primitives/weights/src/weight_v2.rs b/primitives/weights/src/weight_v2.rs index 2aede666dd3da..3946cfe42c8d0 100644 --- a/primitives/weights/src/weight_v2.rs +++ b/primitives/weights/src/weight_v2.rs @@ -97,18 +97,6 @@ impl Weight { } } - /// Construct [`Weight`] with reference time weight and 0 storage size weight. - #[deprecated = "Will be removed soon; use `from_parts` instead."] - pub const fn from_ref_time(ref_time: u64) -> Self { - Self { ref_time, proof_size: 0 } - } - - /// Construct [`Weight`] with storage size weight and 0 reference time weight. - #[deprecated = "Will be removed soon; use `from_parts` instead."] - pub const fn from_proof_size(proof_size: u64) -> Self { - Self { ref_time: 0, proof_size } - } - /// Construct [`Weight`] from weight parts, namely reference time and proof size weights. pub const fn from_parts(ref_time: u64, proof_size: u64) -> Self { Self { ref_time, proof_size } From 717940191150aef10d2e1562f72f5a99d16bedf9 Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Thu, 15 Jun 2023 22:36:28 +0200 Subject: [PATCH 2/3] Add explicit removal dates Signed-off-by: Oliver Tale-Yazdi --- frame/support/procedural/src/lib.rs | 2 +- .../src/pallet/expand/store_trait.rs | 2 +- frame/support/src/dispatch.rs | 2 +- frame/support/src/error.rs | 2 +- frame/support/src/event.rs | 2 +- frame/support/src/storage/migration.rs | 20 ++++++++----------- frame/treasury/src/lib.rs | 5 ++--- 7 files changed, 15 insertions(+), 20 deletions(-) diff --git a/frame/support/procedural/src/lib.rs b/frame/support/procedural/src/lib.rs index 84a8b37f92e06..2b790c6d4d08e 100644 --- a/frame/support/procedural/src/lib.rs +++ b/frame/support/procedural/src/lib.rs @@ -299,7 +299,7 @@ fn counter_prefix(prefix: &str) -> String { /// } /// ``` #[proc_macro] -#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead. +#[deprecated(note = "Will be removed after July 2023; use the attribute `#[pallet]` macro instead. For more info, see: ")] pub fn decl_storage(input: TokenStream) -> TokenStream { storage::decl_storage_impl(input) diff --git a/frame/support/procedural/src/pallet/expand/store_trait.rs b/frame/support/procedural/src/pallet/expand/store_trait.rs index 251c88f08e7a0..6635adc988157 100644 --- a/frame/support/procedural/src/pallet/expand/store_trait.rs +++ b/frame/support/procedural/src/pallet/expand/store_trait.rs @@ -39,7 +39,7 @@ pub fn expand_store_trait(def: &mut Def) -> proc_macro2::TokenStream { let warnig_struct_name = syn::Ident::new("Store", *attribute_span); let warning: syn::ItemStruct = syn::parse_quote!( #[deprecated(note = r" - Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed soon. + Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed after July 2023. Check https://github.com/paritytech/substrate/pull/13535 for more details.")] struct #warnig_struct_name; ); diff --git a/frame/support/src/dispatch.rs b/frame/support/src/dispatch.rs index 60404748a7cf2..9981e5ad65b78 100644 --- a/frame/support/src/dispatch.rs +++ b/frame/support/src/dispatch.rs @@ -899,7 +899,7 @@ impl PaysFee for (u64, Pays) { /// in an externalities-provided environment. Implement /// [`IntegrityTest`](./trait.IntegrityTest.html) trait. #[macro_export] -#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead. +#[deprecated(note = "Will be removed after July 2023; use the attribute `#[pallet]` macro instead. For more info, see: ")] macro_rules! decl_module { // Entry point #1. diff --git a/frame/support/src/error.rs b/frame/support/src/error.rs index fa711389abe18..14dc16d4dd5c2 100644 --- a/frame/support/src/error.rs +++ b/frame/support/src/error.rs @@ -67,7 +67,7 @@ pub use sp_runtime::traits::{BadOrigin, LookupError}; /// For instantiable modules you also need to give the instance generic type and bound to the /// error declaration. #[macro_export] -#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead. +#[deprecated(note = "Will be removed after July 2023; use the attribute `#[pallet]` macro instead. For more info, see: ")] macro_rules! decl_error { ( diff --git a/frame/support/src/event.rs b/frame/support/src/event.rs index ba3e5a2750b63..53a3a68506a62 100644 --- a/frame/support/src/event.rs +++ b/frame/support/src/event.rs @@ -101,7 +101,7 @@ /// # fn main() {} /// ``` #[macro_export] -#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead. +#[deprecated(note = "Will be removed after July 2023; use the attribute `#[pallet]` macro instead. For more info, see: ")] macro_rules! decl_event { ( diff --git a/frame/support/src/storage/migration.rs b/frame/support/src/storage/migration.rs index 8e945afdb6441..568c475bdc69d 100644 --- a/frame/support/src/storage/migration.rs +++ b/frame/support/src/storage/migration.rs @@ -37,18 +37,16 @@ pub struct StorageIterator { impl StorageIterator { /// Construct iterator to iterate over map items in `module` for the map called `item`. - #[deprecated( - note = "Please use the storage_iter or storage_iter_with_suffix functions instead" - )] + #[deprecated(note = "Will be removed after July 2023; Please use the storage_iter or \ + storage_iter_with_suffix functions instead")] pub fn new(module: &[u8], item: &[u8]) -> Self { #[allow(deprecated)] Self::with_suffix(module, item, &[][..]) } /// Construct iterator to iterate over map items in `module` for the map called `item`. - #[deprecated( - note = "Please use the storage_iter or storage_iter_with_suffix functions instead" - )] + #[deprecated(note = "Will be removed after July 2023; Please use the storage_iter or \ + storage_iter_with_suffix functions instead")] pub fn with_suffix(module: &[u8], item: &[u8], suffix: &[u8]) -> Self { let mut prefix = Vec::new(); let storage_prefix = storage_prefix(module, item); @@ -102,18 +100,16 @@ pub struct StorageKeyIterator { impl StorageKeyIterator { /// Construct iterator to iterate over map items in `module` for the map called `item`. - #[deprecated( - note = "Please use the storage_key_iter or storage_key_iter_with_suffix functions instead" - )] + #[deprecated(note = "Will be removed after July 2023; Please use the storage_key_iter or \ + storage_key_iter_with_suffix functions instead")] pub fn new(module: &[u8], item: &[u8]) -> Self { #[allow(deprecated)] Self::with_suffix(module, item, &[][..]) } /// Construct iterator to iterate over map items in `module` for the map called `item`. - #[deprecated( - note = "Please use the storage_key_iter or storage_key_iter_with_suffix functions instead" - )] + #[deprecated(note = "Will be removed after July 2023; Please use the storage_key_iter or \ + storage_key_iter_with_suffix functions instead")] pub fn with_suffix(module: &[u8], item: &[u8], suffix: &[u8]) -> Self { let mut prefix = Vec::new(); let storage_prefix = storage_prefix(module, item); diff --git a/frame/treasury/src/lib.rs b/frame/treasury/src/lib.rs index 847ff96a7a78b..509ab933430bb 100644 --- a/frame/treasury/src/lib.rs +++ b/frame/treasury/src/lib.rs @@ -240,9 +240,8 @@ pub mod pallet { #[cfg(feature = "std")] impl GenesisConfig { /// Direct implementation of `GenesisBuild::assimilate_storage`. - #[deprecated( - note = "use ` as GenesisBuild>::assimilate_storage` instead" - )] + #[deprecated(note = "Will be removed after July 2023; use \ + ` as GenesisBuild>::assimilate_storage` instead")] pub fn assimilate_storage, I: 'static>( &self, storage: &mut sp_runtime::Storage, From ad3b4789c4dd7e3be3a25a3e5c61a5937682be4b Mon Sep 17 00:00:00 2001 From: Oliver Tale-Yazdi Date: Fri, 16 Jun 2023 12:46:13 +0200 Subject: [PATCH 3/3] Upate UI tests Signed-off-by: Oliver Tale-Yazdi --- frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr | 2 +- .../test/tests/pallet_ui/store_trait_leak_private.stderr | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr b/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr index bbc4743fc1003..5d2734b4db601 100644 --- a/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr +++ b/frame/support/test/tests/pallet_ui/deprecated_store_attr.stderr @@ -1,5 +1,5 @@ error: use of deprecated struct `pallet::_::Store`: - Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed soon. + Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed after July 2023. Check https://github.com/paritytech/substrate/pull/13535 for more details. --> tests/pallet_ui/deprecated_store_attr.rs:7:3 | diff --git a/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr b/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr index 24fda4ff1abbf..a8836bc048231 100644 --- a/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr +++ b/frame/support/test/tests/pallet_ui/store_trait_leak_private.stderr @@ -1,5 +1,5 @@ error: use of deprecated struct `pallet::_::Store`: - Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed soon. + Use of `#[pallet::generate_store(pub(super) trait Store)]` will be removed after July 2023. Check https://github.com/paritytech/substrate/pull/13535 for more details. --> tests/pallet_ui/store_trait_leak_private.rs:11:3 |