Improve storage_alias and make UnlockAndUnreserveAllFunds independent of the pallet (#14773)

* Make `storage_alias` more generic over the `prefix`

* Make `UnlockAndUnreserveAllFunds` indepenend from the pallet

* FMT

* Fix error reporting

* Rename prefix type

* Add test

* Apply suggestions from code review

Co-authored-by: Sam Johnson <sam@durosoft.com>

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Sam Johnson <sam@durosoft.com>
Co-authored-by: command-bot <>
This commit is contained in:
Bastian Köcher
2023-08-16 10:15:32 +02:00
committed by GitHub
parent 67964d25a3
commit 04b1e4fbd8
8 changed files with 1103 additions and 916 deletions
@@ -547,8 +547,8 @@ pub fn __create_tt_macro(input: TokenStream) -> TokenStream {
}
#[proc_macro_attribute]
pub fn storage_alias(_: TokenStream, input: TokenStream) -> TokenStream {
storage_alias::storage_alias(input.into())
pub fn storage_alias(attributes: TokenStream, input: TokenStream) -> TokenStream {
storage_alias::storage_alias(attributes.into(), input.into())
.unwrap_or_else(|r| r.into_compile_error())
.into()
}