Disallow burning externally locked nfts (#13054)

* Disallow burning externally locked nfts

* Update docs
This commit is contained in:
Jegor Sidorenko
2023-01-04 10:30:43 +02:00
committed by GitHub
parent ae72d1cdf9
commit 25b4f8c688
4 changed files with 8 additions and 2 deletions
@@ -91,6 +91,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
item: T::ItemId,
with_details: impl FnOnce(&ItemDetailsFor<T, I>) -> DispatchResult,
) -> DispatchResult {
ensure!(!T::Locker::is_locked(collection, item), Error::<T, I>::ItemLocked);
let owner = Collection::<T, I>::try_mutate(
&collection,
|maybe_collection_details| -> Result<T::AccountId, DispatchError> {
+3 -1
View File
@@ -856,7 +856,9 @@ pub mod pallet {
/// Destroy a single item.
///
/// Origin must be Signed and the sender should be the Admin of the `collection`.
/// Origin must be Signed and the signing account must be either:
/// - the Admin of the `collection`;
/// - the Owner of the `item`;
///
/// - `collection`: The collection of the item to be burned.
/// - `item`: The item to be burned.
+1
View File
@@ -189,6 +189,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
item: T::ItemId,
with_details: impl FnOnce(&CollectionDetailsFor<T, I>, &ItemDetailsFor<T, I>) -> DispatchResult,
) -> DispatchResult {
ensure!(!T::Locker::is_locked(collection, item), Error::<T, I>::Locked);
let owner = Collection::<T, I>::try_mutate(
&collection,
|maybe_collection_details| -> Result<T::AccountId, DispatchError> {
+3 -1
View File
@@ -577,7 +577,9 @@ pub mod pallet {
/// Destroy a single item.
///
/// Origin must be Signed and the sender should be the Admin of the `collection`.
/// Origin must be Signed and the signing account must be either:
/// - the Admin of the `collection`;
/// - the Owner of the `item`;
///
/// - `collection`: The collection of the item to be burned.
/// - `item`: The item of the item to be burned.