mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-22 06:45:41 +00:00
pallet-uniques: decrement total_deposit when clearing collection metadata (#3976)
Decrements `total_deposit` when collection metadata is cleared in `pallet-nfts` and `pallet-uniques`.
This commit is contained in:
@@ -247,7 +247,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
);
|
||||
}
|
||||
|
||||
let details =
|
||||
let mut details =
|
||||
Collection::<T, I>::get(&collection).ok_or(Error::<T, I>::UnknownCollection)?;
|
||||
let collection_config = Self::get_collection_config(&collection)?;
|
||||
|
||||
@@ -260,6 +260,8 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
|
||||
CollectionMetadataOf::<T, I>::try_mutate_exists(collection, |metadata| {
|
||||
let deposit = metadata.take().ok_or(Error::<T, I>::UnknownCollection)?.deposit;
|
||||
T::Currency::unreserve(&details.owner, deposit);
|
||||
details.owner_deposit.saturating_reduce(deposit);
|
||||
Collection::<T, I>::insert(&collection, details);
|
||||
Self::deposit_event(Event::CollectionMetadataCleared { collection });
|
||||
Ok(())
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user