mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 19:47:59 +00:00
generate_storage_alias: Rewrite as proc macro attribute (#11387)
* generate_storage_alias: Rewrite as proc macro attribute
This rewrites the `generate_storage_alias!` declarative macro as proc-macro attribute. While doing
this the name is changed to `storage_alias`. The prefix can now also be the name of a pallet. This
makes storage aliases work in migrations for all kind of chains and not just for the ones that use
predefined prefixes.
* Fix compilation and FMT
* Moare fixes
* 🤦
* ......
* Rework the syntax and support instancing
* FMT
* Prefix variants with `Storage`
* Make it compile
* Fix where clause on rust stable
This commit is contained in:
@@ -31,6 +31,7 @@ mod pallet;
|
||||
mod pallet_error;
|
||||
mod partial_eq_no_bound;
|
||||
mod storage;
|
||||
mod storage_alias;
|
||||
mod transactional;
|
||||
mod tt_macro;
|
||||
|
||||
@@ -575,3 +576,10 @@ pub fn derive_pallet_error(input: TokenStream) -> TokenStream {
|
||||
pub fn __create_tt_macro(input: TokenStream) -> TokenStream {
|
||||
tt_macro::create_tt_return_macro(input)
|
||||
}
|
||||
|
||||
#[proc_macro_attribute]
|
||||
pub fn storage_alias(_: TokenStream, input: TokenStream) -> TokenStream {
|
||||
storage_alias::storage_alias(input.into())
|
||||
.unwrap_or_else(|r| r.into_compile_error())
|
||||
.into()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user