From 5ace650460394af9510c6272d3bb8433b573c389 Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Thu, 19 May 2022 21:56:34 +0000 Subject: [PATCH] feat: add rmrk composable key support --- --- a/pallets/proxy-rmrk-core/src/property.rs +++ b/pallets/proxy-rmrk-core/src/property.rs @@ -75,8 +75,8 @@ #[macro_export] macro_rules! rmrk_property { - (Config=$cfg:ty, $key:ident: $value:expr) => {{ - let key = rmrk_property!(@$cfg, $key)?; + (Config=$cfg:ty, $key:ident $(($key_ext:expr))?: $value:expr) => {{ + let key = rmrk_property!(@$cfg, $key $(($key_ext))?)?; let value = $value.into_property_value() .map_err(<$crate::Error<$cfg>>::from)?; @@ -87,12 +87,12 @@ }) }}; - (@$cfg:ty, $key:ident) => { - $crate::RmrkProperty::$key.to_key::<$cfg>() + (@$cfg:ty, $key:ident $(($key_ext:expr))?) => { + $crate::RmrkProperty::$key $(($key_ext))?.to_key::<$cfg>() }; - (Config=$cfg:ty, $key:ident) => { - PropertyScope::Rmrk.apply(rmrk_property!(@$cfg, $key)?) + (Config=$cfg:ty, $key:ident $(($key_ext:expr))?) => { + PropertyScope::Rmrk.apply(rmrk_property!(@$cfg, $key $(($key_ext))?)?) .map_err(|_| <$crate::Error<$cfg>>::RmrkPropertyKeyIsTooLong) }; } -- gitstuff