git.delta.rocks / unique-network / refs/commits / 7faf112aedc7

difftreelog

fix rmrk_property macro

Daniel Shiposha2022-05-18parent: #4e0b740.patch.diff
in: master

2 files changed

modifiedpallets/rmrk-proxy/src/misc.rsdiffbeforeafterboth
1use super::*;1use super::*;
2use codec::{Encode, Decode};2use codec::{Encode, Decode};
3use frame_support::dispatch::Vec;
3use pallet_nonfungible::NonfungibleHandle;4use pallet_nonfungible::NonfungibleHandle;
45
5#[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 };
1314
14 ($key:ident) => {15 (@raw $key:ident) => {
15 RmrkProperty::$key.to_key()16 RmrkProperty::$key.to_key()
16 };17 };
18
19 ($key:ident) => {
20 PropertyScope::Rmrk.apply(rmrk_property!(@raw $key)).unwrap()
21 };
17}22}
1823
19macro_rules! impl_rmrk_value {24macro_rules! impl_rmrk_value {
modifiedprimitives/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",