difftreelog
fix preserve not updated permissions
in: master
2 files changed
pallets/common/src/lib.rsdiffbeforeafterboth1111 new_limit <= MAX_TOKEN_OWNERSHIP,1111 new_limit <= MAX_TOKEN_OWNERSHIP,1112 <Error<T>>::CollectionLimitBoundsExceeded,1112 <Error<T>>::CollectionLimitBoundsExceeded,1113 ),1113 ),1114 sponsor_transfer_timeout(match mode {1115 CollectionMode::NFT => NFT_SPONSOR_TRANSFER_TIMEOUT,1116 CollectionMode::Fungible(_) => FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,1117 CollectionMode::ReFungible => REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,1118 }) => ensure!(1119 new_limit <= MAX_SPONSOR_TIMEOUT,1120 <Error<T>>::CollectionLimitBoundsExceeded,1121 ),1122 sponsored_data_size => ensure!(1114 sponsored_data_size => ensure!(1123 new_limit <= CUSTOM_DATA_LIMIT,1115 new_limit <= CUSTOM_DATA_LIMIT,1124 <Error<T>>::CollectionLimitBoundsExceeded,1116 <Error<T>>::CollectionLimitBoundsExceeded,1125 ),1117 ),11181119 sponsored_data_rate_limit => {},1126 token_limit => ensure!(1120 token_limit => ensure!(1127 old_limit >= new_limit && new_limit > 0,1121 old_limit >= new_limit && new_limit > 0,1128 <Error<T>>::CollectionTokenLimitExceeded1122 <Error<T>>::CollectionTokenLimitExceeded1129 ),1123 ),11241125 sponsor_transfer_timeout(match mode {1126 CollectionMode::NFT => NFT_SPONSOR_TRANSFER_TIMEOUT,1127 CollectionMode::Fungible(_) => FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,1128 CollectionMode::ReFungible => REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,1129 }) => ensure!(1130 new_limit <= MAX_SPONSOR_TIMEOUT,1131 <Error<T>>::CollectionLimitBoundsExceeded,1132 ),1133 sponsor_approve_timeout => {},1130 owner_can_transfer => ensure!(1134 owner_can_transfer => ensure!(1131 old_limit || !new_limit,1135 old_limit || !new_limit,1132 <Error<T>>::OwnerPermissionsCantBeReverted,1136 <Error<T>>::OwnerPermissionsCantBeReverted,1135 old_limit || !new_limit,1139 old_limit || !new_limit,1136 <Error<T>>::OwnerPermissionsCantBeReverted,1140 <Error<T>>::OwnerPermissionsCantBeReverted,1137 ),1141 ),1138 sponsored_data_rate_limit => {},1139 transfers_enabled => {},1142 transfers_enabled => {},1140 );1143 );1141 Ok(new_limit)1144 Ok(new_limit)1146 mut new_limit: CollectionPermissions,1149 mut new_limit: CollectionPermissions,1147 ) -> Result<CollectionPermissions, DispatchError> {1150 ) -> Result<CollectionPermissions, DispatchError> {1148 limit_default_clone!(old_limit, new_limit,1151 limit_default_clone!(old_limit, new_limit,1152 access => {},1153 mint_mode => {},1154 nesting => {},1149 );1155 );1150 Ok(new_limit)1156 Ok(new_limit)1151 }1157 }primitives/data-structs/src/lib.rsdiffbeforeafterboth--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -365,6 +365,7 @@
BoundedVec<Property, ConstU32<MAX_PROPERTIES_PER_ITEM>>;
/// All fields are wrapped in `Option`s, where None means chain default
+// When adding/removing fields from this struct - don't forget to also update clamp_limits
#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct CollectionLimits {
@@ -432,6 +433,7 @@
}
}
+// When adding/removing fields from this struct - don't forget to also update clamp_limits
#[derive(Encode, Decode, Debug, Default, Clone, PartialEq, TypeInfo, MaxEncodedLen)]
#[cfg_attr(feature = "serde1", derive(Serialize, Deserialize))]
pub struct CollectionPermissions {