Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Deprecate Pallet decl_* Macros #13705

Merged
merged 10 commits into from
May 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions frame/support/procedural/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,8 @@ fn counter_prefix(prefix: &str) -> String {
/// }
/// ```
#[proc_macro]
#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead.
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
pub fn decl_storage(input: TokenStream) -> TokenStream {
storage::decl_storage_impl(input)
}
Expand Down
3 changes: 3 additions & 0 deletions frame/support/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,8 @@ impl<T> PaysFee<T> 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.
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
macro_rules! decl_module {
// Entry point #1.
(
Expand Down Expand Up @@ -3197,6 +3199,7 @@ macro_rules! __check_reserved_fn_name {
#[cfg(test)]
// Do not complain about unused `dispatch` and `dispatch_aux`.
#[allow(dead_code)]
#[allow(deprecated)]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test will be deleted once the syntax is gone.

mod tests {
use super::*;
use crate::{
Expand Down
2 changes: 2 additions & 0 deletions frame/support/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ 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.
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
macro_rules! decl_error {
(
$(#[$attr:meta])*
Expand Down
2 changes: 2 additions & 0 deletions frame/support/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@
/// # fn main() {}
/// ```
#[macro_export]
#[deprecated(note = "Will be removed soon; use the attribute `#[pallet]` macro instead.
For more info, see: <https://github.com/paritytech/substrate/pull/13705>")]
macro_rules! decl_event {
(
$(#[$attr:meta])*
Expand Down