Skip to content

Commit 2a148e3

Browse files
authored
Deprecate Pallet decl_* Macros (paritytech#13705)
* Deprecate decl_ macros Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Allow deprecated in tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert "Allow deprecated in tests" This reverts commit ce36080. * Deprecate all Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Push missing files Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * fmt Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Move decl_module to own file Otherwise i have to spam allow(deprecated) for all recursive calls. Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> * Revert "Move decl_module to own file" This reverts commit 543a311. * Fix tests Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io> --------- Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
1 parent 65e7ab6 commit 2a148e3

4 files changed

Lines changed: 9 additions & 0 deletions

File tree

frame/support/procedural/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,8 @@ fn counter_prefix(prefix: &str) -> String {
296296
/// }
297297
/// ```
298298
#[proc_macro]
299+
#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead.
300+
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
299301
pub fn decl_storage(input: TokenStream) -> TokenStream {
300302
storage::decl_storage_impl(input)
301303
}

frame/support/src/dispatch.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -879,6 +879,8 @@ impl<T> PaysFee<T> for (u64, Pays) {
879879
/// in an externalities-provided environment. Implement
880880
/// [`IntegrityTest`](./trait.IntegrityTest.html) trait.
881881
#[macro_export]
882+
#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead.
883+
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
882884
macro_rules! decl_module {
883885
// Entry point #1.
884886
(
@@ -3197,6 +3199,7 @@ macro_rules! __check_reserved_fn_name {
31973199
#[cfg(test)]
31983200
// Do not complain about unused `dispatch` and `dispatch_aux`.
31993201
#[allow(dead_code)]
3202+
#[allow(deprecated)]
32003203
mod tests {
32013204
use super::*;
32023205
use crate::{

frame/support/src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,8 @@ pub use sp_runtime::traits::{BadOrigin, LookupError};
6767
/// For instantiable modules you also need to give the instance generic type and bound to the
6868
/// error declaration.
6969
#[macro_export]
70+
#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead.
71+
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
7072
macro_rules! decl_error {
7173
(
7274
$(#[$attr:meta])*

frame/support/src/event.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@
101101
/// # fn main() {}
102102
/// ```
103103
#[macro_export]
104+
#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead.
105+
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
104106
macro_rules! decl_event {
105107
(
106108
$(#[$attr:meta])*

0 commit comments

Comments
 (0)