style: Migrate to stable-only rustfmt configuration
- Remove nightly-only features from .rustfmt.toml and vendor/ss58-registry/rustfmt.toml - Removed features: imports_granularity, wrap_comments, comment_width, reorder_impl_items, spaces_around_ranges, binop_separator, match_arm_blocks, trailing_semicolon, trailing_comma - Format all 898 affected files with stable rustfmt - Ensures long-term reliability without nightly toolchain dependency
This commit is contained in:
@@ -99,8 +99,8 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
|
||||
let mut deposit = Zero::zero();
|
||||
// disabled DepositRequired setting only affects the CollectionOwner namespace
|
||||
if collection_config.is_setting_enabled(CollectionSetting::DepositRequired) ||
|
||||
namespace != AttributeNamespace::CollectionOwner
|
||||
if collection_config.is_setting_enabled(CollectionSetting::DepositRequired)
|
||||
|| namespace != AttributeNamespace::CollectionOwner
|
||||
{
|
||||
deposit = T::DepositPerByte::get()
|
||||
.saturating_mul(((key.len() + value.len()) as u32).into())
|
||||
@@ -461,19 +461,22 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
) -> Result<bool, DispatchError> {
|
||||
let mut result = false;
|
||||
match namespace {
|
||||
AttributeNamespace::CollectionOwner =>
|
||||
result = Self::has_role(&collection, &origin, CollectionRole::Admin),
|
||||
AttributeNamespace::ItemOwner =>
|
||||
AttributeNamespace::CollectionOwner => {
|
||||
result = Self::has_role(&collection, &origin, CollectionRole::Admin)
|
||||
},
|
||||
AttributeNamespace::ItemOwner => {
|
||||
if let Some(item) = maybe_item {
|
||||
let item_details =
|
||||
Item::<T, I>::get(&collection, &item).ok_or(Error::<T, I>::UnknownItem)?;
|
||||
result = origin == &item_details.owner
|
||||
},
|
||||
AttributeNamespace::Account(account_id) =>
|
||||
}
|
||||
},
|
||||
AttributeNamespace::Account(account_id) => {
|
||||
if let Some(item) = maybe_item {
|
||||
let approvals = ItemAttributesApprovalsOf::<T, I>::get(&collection, &item);
|
||||
result = account_id == origin && approvals.contains(&origin)
|
||||
},
|
||||
}
|
||||
},
|
||||
_ => (),
|
||||
};
|
||||
Ok(result)
|
||||
|
||||
@@ -253,8 +253,8 @@ impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
|
||||
let collection_config = Self::get_collection_config(&collection)?;
|
||||
|
||||
ensure!(
|
||||
maybe_check_origin.is_none() ||
|
||||
collection_config.is_setting_enabled(CollectionSetting::UnlockedMetadata),
|
||||
maybe_check_origin.is_none()
|
||||
|| collection_config.is_setting_enabled(CollectionSetting::UnlockedMetadata),
|
||||
Error::<T, I>::LockedCollectionMetadata
|
||||
);
|
||||
|
||||
|
||||
@@ -128,9 +128,11 @@ impl<T: Config<I>, I: 'static> Inspect<<T as SystemConfig>::AccountId> for Pezpa
|
||||
ItemConfigOf::<T, I>::get(collection, item),
|
||||
) {
|
||||
(Some(cc), Some(ic))
|
||||
if cc.is_setting_enabled(CollectionSetting::TransferableItems) &&
|
||||
ic.is_setting_enabled(ItemSetting::Transferable) =>
|
||||
true,
|
||||
if cc.is_setting_enabled(CollectionSetting::TransferableItems)
|
||||
&& ic.is_setting_enabled(ItemSetting::Transferable) =>
|
||||
{
|
||||
true
|
||||
},
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1443,8 +1443,9 @@ pub mod pezpallet {
|
||||
) -> DispatchResult {
|
||||
let origin = ensure_signed(origin)?;
|
||||
let depositor = match namespace {
|
||||
AttributeNamespace::CollectionOwner =>
|
||||
Self::collection_owner(collection).ok_or(Error::<T, I>::UnknownCollection)?,
|
||||
AttributeNamespace::CollectionOwner => {
|
||||
Self::collection_owner(collection).ok_or(Error::<T, I>::UnknownCollection)?
|
||||
},
|
||||
_ => origin.clone(),
|
||||
};
|
||||
Self::do_set_attribute(origin, collection, maybe_item, namespace, key, value, depositor)
|
||||
|
||||
@@ -3114,9 +3114,9 @@ fn collection_locking_should_work() {
|
||||
|
||||
let stored_config = CollectionConfigOf::<Test>::get(collection_id).unwrap();
|
||||
let full_lock_config = collection_config_from_disabled_settings(
|
||||
CollectionSetting::TransferableItems |
|
||||
CollectionSetting::UnlockedMetadata |
|
||||
CollectionSetting::UnlockedAttributes,
|
||||
CollectionSetting::TransferableItems
|
||||
| CollectionSetting::UnlockedMetadata
|
||||
| CollectionSetting::UnlockedAttributes,
|
||||
);
|
||||
assert_eq!(stored_config, full_lock_config);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user