git.delta.rocks / unique-network / refs/commits / 12a441c421f3

difftreelog

fix debug check if new token doesnt have any properties

Daniel Shiposha2023-09-26parent: #9b4620c.patch.diff
in: master

2 files changed

modifiedpallets/nonfungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/lib.rs
+++ b/pallets/nonfungible/src/lib.rs
@@ -632,6 +632,10 @@
 		});
 
 		let stored_properties = if is_new_token {
+			debug_assert!(!<TokenProperties<T>>::contains_key((
+				collection.id,
+				token_id
+			)));
 			TokenPropertiesT::new()
 		} else {
 			<TokenProperties<T>>::get((collection.id, token_id))
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
575 });575 });
576576
577 let stored_properties = if is_new_token {577 let stored_properties = if is_new_token {
578 debug_assert!(!<TokenProperties<T>>::contains_key((
579 collection.id,
580 token_id
581 )));
578 TokenPropertiesT::new()582 TokenPropertiesT::new()
579 } else {583 } else {
580 <TokenProperties<T>>::get((collection.id, token_id))584 <TokenProperties<T>>::get((collection.id, token_id))