Skip to content

Commit

Permalink
chore: rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
chungquantin committed Jan 24, 2025
1 parent e511596 commit 76acc65
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 91 deletions.
72 changes: 0 additions & 72 deletions pallets/api/src/nonfungibles/impls.rs

This file was deleted.

9 changes: 6 additions & 3 deletions pallets/api/src/nonfungibles/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ extern crate alloc;

use frame_support::{
dispatch::WithPostDispatchInfo,
traits::{nonfungibles_v2::Inspect, Currency},
traits::{
nonfungibles_v2::{Destroy, Inspect},
Currency,
},
};
use frame_system::pallet_prelude::BlockNumberFor;
pub use pallet::*;
Expand Down Expand Up @@ -259,11 +262,11 @@ pub mod pallet {
Ok(().into())
}

/// Destroy a collection of fungible items.
/// Destroy a collection of fungible items.
///
/// # Parameters
/// - `collection` - The collection to destroy.
#[pallet::call_index(8)]
#[pallet::call_index(13)]
#[pallet::weight(NftsWeightInfoOf::<T>::destroy(u32::MAX, u32::MAX, u32::MAX))]
pub fn destroy(
origin: OriginFor<T>,
Expand Down
21 changes: 5 additions & 16 deletions pallets/api/src/nonfungibles/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ use crate::{
nonfungibles::{
AccountBalanceOf, AttributeNamespace, AttributeOf, BlockNumberFor,
CancelAttributesApprovalWitness, CollectionConfig, CollectionDetails, CollectionIdOf,
CollectionOf, CollectionSettings, Config, DestroyWitness, ItemIdOf, MintSettings,
MintWitness, NextCollectionIdOf, NftsErrorOf, NftsInstanceOf, NftsWeightInfoOf, Read::*,
ReadResult, WeightInfo as WeightInfoTrait,
CollectionOf, CollectionSettings, Config, ItemIdOf, MintSettings, MintWitness,
NextCollectionIdOf, NftsErrorOf, NftsInstanceOf, NftsWeightInfoOf, Read::*, ReadResult,
WeightInfo as WeightInfoTrait,
},
Read,
};
Expand Down Expand Up @@ -327,7 +327,7 @@ fn destroy_works() {
// Check error works for `Nfts::destroy()`.
assert_noop!(
NonFungibles::destroy(signed(ALICE), collection),
NftsError::UnknownCollection.with_weight(Weight::from_parts(0, 0))
NftsError::UnknownCollection.with_weight(DbWeight::get().reads(1))
);
nfts::create_collection(ALICE);
assert_eq!(
Expand Down Expand Up @@ -1022,18 +1022,7 @@ mod ensure_codec_indexes {
),
(burn { collection: Default::default(), item: Default::default() }, 8, "burn"),
(create { admin: Default::default(), config: Default::default() }, 12, "create"),
(
destroy {
collection: Default::default(),
witness: DestroyWitness {
item_metadatas: Default::default(),
item_configs: Default::default(),
attributes: Default::default(),
},
},
13,
"destroy",
),
(destroy { collection: Default::default() }, 13, "destroy"),
(
set_attribute {
collection: Default::default(),
Expand Down

0 comments on commit 76acc65

Please sign in to comment.