git.delta.rocks / unique-network / refs/commits / 31074fa5c591

difftreelog

fix preserve not updated permissions

Yaroslav Bolyukin2022-05-30parent: #ab91887.patch.diff
in: master

2 files changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -1111,6 +1111,17 @@
 				new_limit <= MAX_TOKEN_OWNERSHIP,
 				<Error<T>>::CollectionLimitBoundsExceeded,
 			),
+			sponsored_data_size => ensure!(
+				new_limit <= CUSTOM_DATA_LIMIT,
+				<Error<T>>::CollectionLimitBoundsExceeded,
+			),
+
+			sponsored_data_rate_limit => {},
+			token_limit => ensure!(
+				old_limit >= new_limit && new_limit > 0,
+				<Error<T>>::CollectionTokenLimitExceeded
+			),
+
 			sponsor_transfer_timeout(match mode {
 				CollectionMode::NFT => NFT_SPONSOR_TRANSFER_TIMEOUT,
 				CollectionMode::Fungible(_) => FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,
@@ -1119,14 +1130,7 @@
 				new_limit <= MAX_SPONSOR_TIMEOUT,
 				<Error<T>>::CollectionLimitBoundsExceeded,
 			),
-			sponsored_data_size => ensure!(
-				new_limit <= CUSTOM_DATA_LIMIT,
-				<Error<T>>::CollectionLimitBoundsExceeded,
-			),
-			token_limit => ensure!(
-				old_limit >= new_limit && new_limit > 0,
-				<Error<T>>::CollectionTokenLimitExceeded
-			),
+			sponsor_approve_timeout => {},
 			owner_can_transfer => ensure!(
 				old_limit || !new_limit,
 				<Error<T>>::OwnerPermissionsCantBeReverted,
@@ -1135,7 +1139,6 @@
 				old_limit || !new_limit,
 				<Error<T>>::OwnerPermissionsCantBeReverted,
 			),
-			sponsored_data_rate_limit => {},
 			transfers_enabled => {},
 		);
 		Ok(new_limit)
@@ -1146,6 +1149,9 @@
 		mut new_limit: CollectionPermissions,
 	) -> Result<CollectionPermissions, DispatchError> {
 		limit_default_clone!(old_limit, new_limit,
+			access => {},
+			mint_mode => {},
+			nesting => {},
 		);
 		Ok(new_limit)
 	}
modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
365 BoundedVec<Property, ConstU32<MAX_PROPERTIES_PER_ITEM>>;365 BoundedVec<Property, ConstU32<MAX_PROPERTIES_PER_ITEM>>;
366366
367/// All fields are wrapped in `Option`s, where None means chain default367/// All fields are wrapped in `Option`s, where None means chain default
368// When adding/removing fields from this struct - don't forget to also update clamp_limits
368#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]369#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
369#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]370#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
370pub struct CollectionLimits {371pub struct CollectionLimits {
432 }433 }
433}434}
434435
436// When adding/removing fields from this struct - don't forget to also update clamp_limits
435#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]437#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
436#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]438#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
437pub struct CollectionPermissions {439pub struct CollectionPermissions {