rmrk-team / rmrk-substrate

[WIP] RMRK Substrate pallets

Home Page:https://rmrk.app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Have a way to bulk remove properties

h4x3rotab opened this issue · comments

In almost all the cases, the properties should be removed when the NFT is burnt. Now we only have this, but it's less efficient compared with draining an iterator:

// Internal function to remove a property for downstream `Origin::root()` calls.
fn do_remove_property(
collection_id: T::CollectionId,
maybe_nft_id: Option<T::ItemId>,
key: KeyLimitOf<T>,
) -> sp_runtime::DispatchResult {
Properties::<T>::remove((&collection_id, maybe_nft_id, &key));
Self::deposit_event(Event::PropertyRemoved { collection_id, maybe_nft_id, key });
Ok(())
}
}