difftreelog
fix rmrk_property macro
in: master
2 files changed
pallets/rmrk-proxy/src/misc.rsdiffbeforeafterboth1use super::*;1use super::*;2use codec::{Encode, Decode};2use codec::{Encode, Decode};3use frame_support::dispatch::Vec;3use pallet_nonfungible::NonfungibleHandle;4use pallet_nonfungible::NonfungibleHandle;455#[macro_export]6#[macro_export]6macro_rules! rmrk_property {7macro_rules! rmrk_property {7 ($key:ident, $value:expr) => {8 ($key:ident, $value:expr) => {8 Property {9 Property {9 key: rmrk_property!($key),10 key: rmrk_property!(@raw $key),10 value: $value.into()11 value: $value.into()11 }12 }12 };13 };131414 ($key:ident) => {15 (@raw $key:ident) => {15 RmrkProperty::$key.to_key()16 RmrkProperty::$key.to_key()16 };17 };1819 ($key:ident) => {20 PropertyScope::Rmrk.apply(rmrk_property!(@raw $key)).unwrap()21 };17}22}182319macro_rules! impl_rmrk_value {24macro_rules! impl_rmrk_value {primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -678,6 +678,7 @@
}
}
+#[derive(Debug)]
pub enum PropertiesError {
NoSpaceForProperty,
PropertyLimitReached,
@@ -693,7 +694,7 @@
}
impl PropertyScope {
- fn apply(self, key: PropertyKey) -> Result<PropertyKey, PropertiesError> {
+ pub fn apply(self, key: PropertyKey) -> Result<PropertyKey, PropertiesError> {
let scope_str: &[u8] = match self {
Self::None => return Ok(key),
Self::Rmrk => b"rmrk",