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.rsdiffbeforeafterboth678 }678 }679}679}680680681#[derive(Debug)]681pub enum PropertiesError {682pub enum PropertiesError {682 NoSpaceForProperty,683 NoSpaceForProperty,683 PropertyLimitReached,684 PropertyLimitReached,693}694}694695695impl PropertyScope {696impl PropertyScope {696 fn apply(self, key: PropertyKey) -> Result<PropertyKey, PropertiesError> {697 pub fn apply(self, key: PropertyKey) -> Result<PropertyKey, PropertiesError> {697 let scope_str: &[u8] = match self {698 let scope_str: &[u8] = match self {698 Self::None => return Ok(key),699 Self::None => return Ok(key),699 Self::Rmrk => b"rmrk",700 Self::Rmrk => b"rmrk",