Skip to content

Commit

Permalink
Deprecate Pallet decl_* Macros (paritytech#13705)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
ggwpez authored and nathanwhit committed Jul 19, 2023
1 parent 4da0493 commit e284da2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
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)]
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

0 comments on commit e284da2

Please sign in to comment.