Skip to content

Commit

Permalink
feat: nfts pallet optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Nov 22, 2024
1 parent 94c2806 commit a217fd6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion pallets/nfts/src/features/approvals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
.try_insert(delegate.clone(), deadline)
.map_err(|_| Error::<T, I>::ReachedApprovalLimit)?;
Item::<T, I>::insert(collection, item, &details);

Self::deposit_event(Event::TransferApproved {
collection,
item: Some(item),
Expand Down
5 changes: 3 additions & 2 deletions pallets/nfts/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1476,8 +1476,9 @@ pub mod pallet {
) -> 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)
Expand Down
6 changes: 3 additions & 3 deletions pallets/nfts/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3399,9 +3399,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);
});
Expand Down

0 comments on commit a217fd6

Please sign in to comment.