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
632 });632 });
633633
634 let stored_properties = if is_new_token {634 let stored_properties = if is_new_token {
635 debug_assert!(!<TokenProperties<T>>::contains_key((
636 collection.id,
637 token_id
638 )));
635 TokenPropertiesT::new()639 TokenPropertiesT::new()
636 } else {640 } else {
637 <TokenProperties<T>>::get((collection.id, token_id))641 <TokenProperties<T>>::get((collection.id, token_id))
modifiedpallets/refungible/src/lib.rsdiffbeforeafterboth
--- a/pallets/refungible/src/lib.rs
+++ b/pallets/refungible/src/lib.rs
@@ -575,6 +575,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))