mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-12 17:01:09 +00:00
Disallow burning externally locked nfts (#13054)
* Disallow burning externally locked nfts * Update docs
This commit is contained in:
@@ -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> {
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user