mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-11 12:55:46 +00:00
Macros to use path instead of ident (#1474)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
use frame_support_procedural_tools::generate_access_from_frame_or_crate;
|
||||
use proc_macro2::{Span, TokenStream};
|
||||
use quote::{format_ident, quote, ToTokens};
|
||||
use syn::{Ident, Result};
|
||||
@@ -27,6 +28,7 @@ pub fn impl_key_prefix_for_tuples(input: proc_macro::TokenStream) -> Result<Toke
|
||||
}
|
||||
|
||||
let mut all_trait_impls = TokenStream::new();
|
||||
let frame_support = generate_access_from_frame_or_crate("frame-support")?;
|
||||
|
||||
for i in 2..=MAX_IDENTS {
|
||||
let current_tuple = (0..i)
|
||||
@@ -64,7 +66,10 @@ pub fn impl_key_prefix_for_tuples(input: proc_macro::TokenStream) -> Result<Toke
|
||||
#(#hashers: ReversibleStorageHasher,)*
|
||||
#(#kargs: EncodeLike<#prefixes>),*
|
||||
> HasReversibleKeyPrefix<( #( #kargs, )* )> for ( #( Key<#hashers, #current_tuple>, )* ) {
|
||||
fn decode_partial_key(key_material: &[u8]) -> Result<Self::Suffix, codec::Error> {
|
||||
fn decode_partial_key(key_material: &[u8]) -> Result<
|
||||
Self::Suffix,
|
||||
#frame_support::__private::codec::Error,
|
||||
> {
|
||||
<#suffix_keygen>::decode_final_key(key_material).map(|k| k.0)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user