diff --git a/pallets/phala-world/src/incubation.rs b/pallets/phala-world/src/incubation.rs index 70731d06..7ea8c08c 100644 --- a/pallets/phala-world/src/incubation.rs +++ b/pallets/phala-world/src/incubation.rs @@ -162,7 +162,7 @@ pub mod pallet { #[pallet::call] impl Pallet where - T: pallet_uniques::Config, + T: pallet_uniques::Config, { /// Once users have received their origin_of_shells and the start incubation event has been /// triggered, they can start the incubation process and a timer will start for the @@ -252,7 +252,7 @@ pub mod pallet { ); // Check if account owns an Origin of Shell NFT ensure!( - pallet_uniques::pallet::Pallet::::owned_in_class(&collection_id, &sender) + pallet_uniques::pallet::Pallet::::owned_in_collection(&collection_id, &sender) .count() > 0, Error::::CannotSendFoodToOriginOfShell ); @@ -375,7 +375,7 @@ pub mod pallet { let rarity_type: RarityType = Decode::decode(&mut rarity_type_value.as_slice()) .expect("[rarity] should not fail"); let generation_id: GenerationId = - Decode::decode(&mut generation.as_slice()).expect("[generation should not fail"); + Decode::decode(&mut generation.as_slice()).expect("[generation] should not fail"); // Get Shell Collection next NFT ID let shell_nft_id = pallet_rmrk_core::NextNftId::::get(shell_collection_id); // Burn Origin of Shell NFT then Mint Shell NFT @@ -403,6 +403,12 @@ pub mod pallet { Some(nft_id), rarity_type_key, )?; + pallet_uniques::Pallet::::clear_attribute( + origin.clone(), + collection_id, + Some(nft_id), + generation_key, + )?; // Mint Shell NFT to Overlord to add attributes and resource before sending to owner pallet_rmrk_core::Pallet::::mint_nft( origin.clone(), @@ -532,7 +538,7 @@ pub mod pallet { impl Pallet where - T: pallet_uniques::Config, + T: pallet_uniques::Config, { /// Helper function to ensure that the sender owns the origin of shell NFT. /// diff --git a/pallets/phala-world/src/mock.rs b/pallets/phala-world/src/mock.rs index 477316a1..bed8a145 100644 --- a/pallets/phala-world/src/mock.rs +++ b/pallets/phala-world/src/mock.rs @@ -115,8 +115,8 @@ impl pallet_rmrk_core::Config for Test { } parameter_types! { - pub const ClassDeposit: Balance = 10_000 * PHA; // 1 UNIT deposit to create asset class - pub const InstanceDeposit: Balance = 100 * PHA; // 1/100 UNIT deposit to create asset instance + pub const CollectionDeposit: Balance = 10_000 * PHA; // 1 UNIT deposit to create collection + pub const ItemDeposit: Balance = 100 * PHA; // 1/100 UNIT deposit to create item pub const KeyLimit: u32 = 32; // Max 32 bytes per key pub const ValueLimit: u32 = 64; // Max 64 bytes per value pub const UniquesMetadataDepositBase: Balance = 1000 * PHA; @@ -127,14 +127,14 @@ parameter_types! { impl pallet_uniques::Config for Test { type Event = Event; - type ClassId = u32; - type InstanceId = u32; + type CollectionId = u32; + type ItemId = u32; type Currency = Balances; type ForceOrigin = EnsureRoot; type CreateOrigin = AsEnsureOriginWithArg>; type Locker = pallet_rmrk_core::Pallet; - type ClassDeposit = ClassDeposit; - type InstanceDeposit = InstanceDeposit; + type CollectionDeposit = CollectionDeposit; + type ItemDeposit = ItemDeposit; type MetadataDepositBase = UniquesMetadataDepositBase; type AttributeDepositBase = AttributeDepositBase; type DepositPerByte = DepositPerByte; diff --git a/pallets/phala-world/src/nft_sale.rs b/pallets/phala-world/src/nft_sale.rs index b6c7595d..f30cb3c2 100644 --- a/pallets/phala-world/src/nft_sale.rs +++ b/pallets/phala-world/src/nft_sale.rs @@ -233,7 +233,7 @@ pub mod pallet { #[pallet::genesis_build] impl GenesisBuild for GenesisConfig where - T: pallet_uniques::Config, + T: pallet_uniques::Config, { fn build(&self) { if let Some(ref zero_day) = self.zero_day { @@ -384,7 +384,7 @@ pub mod pallet { #[pallet::call] impl Pallet where - T: pallet_uniques::Config, + T: pallet_uniques::Config, { /// Claim a spirit for any account with at least 10 PHA in their account /// @@ -1047,7 +1047,7 @@ pub mod pallet { impl Pallet where - T: pallet_uniques::Config, + T: pallet_uniques::Config, { /// Verify the sender making the claim is the Account signed by the Overlord admin account and /// verify the purpose of the `OverlordMessage` which will be either `RedeemSpirit` or @@ -1628,7 +1628,7 @@ where /// `collection_id`: Collection id to check if sender owns a NFT in the collection /// `error`: Error type to throw if there is an error detected pub fn owns_nft_in_collection(sender: &T::AccountId, collection_id: CollectionId) -> bool { - pallet_uniques::Pallet::::owned_in_class(&collection_id, sender).count() > 0 + pallet_uniques::Pallet::::owned_in_collection(&collection_id, sender).count() > 0 } pub fn to_boundedvec_key(name: &str) -> Result, Error> { diff --git a/runtime/khala/src/lib.rs b/runtime/khala/src/lib.rs index 68168958..7e7381a3 100644 --- a/runtime/khala/src/lib.rs +++ b/runtime/khala/src/lib.rs @@ -315,18 +315,18 @@ impl Contains for BaseCallFilter { pallet_uniques::Call::approve_transfer { .. } | pallet_uniques::Call::burn { .. } | pallet_uniques::Call::cancel_approval { .. } - | pallet_uniques::Call::clear_class_metadata { .. } + | pallet_uniques::Call::clear_collection_metadata { .. } | pallet_uniques::Call::clear_metadata { .. } | pallet_uniques::Call::create { .. } | pallet_uniques::Call::destroy { .. } - | pallet_uniques::Call::force_asset_status { .. } + | pallet_uniques::Call::force_item_status { .. } | pallet_uniques::Call::force_create { .. } - | pallet_uniques::Call::freeze_class { .. } + | pallet_uniques::Call::freeze_collection { .. } | pallet_uniques::Call::mint { .. } | pallet_uniques::Call::redeposit { .. } - | pallet_uniques::Call::set_class_metadata { .. } + | pallet_uniques::Call::set_collection_metadata { .. } | pallet_uniques::Call::set_metadata { .. } - | pallet_uniques::Call::thaw_class { .. } + | pallet_uniques::Call::thaw_collection { .. } | pallet_uniques::Call::transfer { .. } | pallet_uniques::Call::transfer_ownership { .. } | pallet_uniques::Call::__Ignore { .. } => false, @@ -821,8 +821,8 @@ impl cumulus_pallet_parachain_system::Config for Runtime { } parameter_types! { - pub const ClassDeposit: Balance = 100 * DOLLARS; - pub const InstanceDeposit: Balance = 1 * DOLLARS; + pub const CollectionDeposit: Balance = 100 * DOLLARS; + pub const ItemDeposit: Balance = 1 * DOLLARS; pub const KeyLimit: u32 = 32; pub const ValueLimit: u32 = 256; pub const StringLimit: u32 = 50; @@ -836,8 +836,8 @@ impl pallet_uniques::Config for Runtime { type ForceOrigin = EnsureRoot; type CreateOrigin = AsEnsureOriginWithArg>; type Locker = (); - type CollectionDeposit = ClassDeposit; - type ItemDeposit = InstanceDeposit; + type CollectionDeposit = CollectionDeposit; + type ItemDeposit = ItemDeposit; type MetadataDepositBase = MetadataDepositBase; type AttributeDepositBase = MetadataDepositBase; type DepositPerByte = MetadataDepositPerByte; diff --git a/runtime/rhala/src/lib.rs b/runtime/rhala/src/lib.rs index 81a1046b..ac04c839 100644 --- a/runtime/rhala/src/lib.rs +++ b/runtime/rhala/src/lib.rs @@ -316,18 +316,18 @@ impl Contains for BaseCallFilter { pallet_uniques::Call::approve_transfer { .. } | pallet_uniques::Call::burn { .. } | pallet_uniques::Call::cancel_approval { .. } - | pallet_uniques::Call::clear_class_metadata { .. } + | pallet_uniques::Call::clear_collection_metadata { .. } | pallet_uniques::Call::clear_metadata { .. } | pallet_uniques::Call::create { .. } | pallet_uniques::Call::destroy { .. } - | pallet_uniques::Call::force_asset_status { .. } + | pallet_uniques::Call::force_item_status { .. } | pallet_uniques::Call::force_create { .. } - | pallet_uniques::Call::freeze_class { .. } + | pallet_uniques::Call::freeze_collection { .. } | pallet_uniques::Call::mint { .. } | pallet_uniques::Call::redeposit { .. } - | pallet_uniques::Call::set_class_metadata { .. } + | pallet_uniques::Call::set_collection_metadata { .. } | pallet_uniques::Call::set_metadata { .. } - | pallet_uniques::Call::thaw_class { .. } + | pallet_uniques::Call::thaw_collection { .. } | pallet_uniques::Call::transfer { .. } | pallet_uniques::Call::transfer_ownership { .. } | pallet_uniques::Call::__Ignore { .. } => false, @@ -828,8 +828,8 @@ impl cumulus_pallet_parachain_system::Config for Runtime { } parameter_types! { - pub const ClassDeposit: Balance = 100 * DOLLARS; - pub const InstanceDeposit: Balance = 1 * DOLLARS; + pub const CollectionDeposit: Balance = 100 * DOLLARS; + pub const ItemDeposit: Balance = 1 * DOLLARS; pub const KeyLimit: u32 = 32; pub const ValueLimit: u32 = 256; pub const StringLimit: u32 = 50; @@ -843,8 +843,8 @@ impl pallet_uniques::Config for Runtime { type ForceOrigin = EnsureRoot; type CreateOrigin = AsEnsureOriginWithArg>; type Locker = (); - type CollectionDeposit = ClassDeposit; - type ItemDeposit = InstanceDeposit; + type CollectionDeposit = CollectionDeposit; + type ItemDeposit = ItemDeposit; type MetadataDepositBase = MetadataDepositBase; type AttributeDepositBase = MetadataDepositBase; type DepositPerByte = MetadataDepositPerByte; diff --git a/runtime/thala/src/lib.rs b/runtime/thala/src/lib.rs index 5f57e9c6..38217c7f 100644 --- a/runtime/thala/src/lib.rs +++ b/runtime/thala/src/lib.rs @@ -323,18 +323,18 @@ impl Contains for BaseCallFilter { pallet_uniques::Call::approve_transfer { .. } | pallet_uniques::Call::burn { .. } | pallet_uniques::Call::cancel_approval { .. } - | pallet_uniques::Call::clear_class_metadata { .. } + | pallet_uniques::Call::clear_collection_metadata { .. } | pallet_uniques::Call::clear_metadata { .. } | pallet_uniques::Call::create { .. } | pallet_uniques::Call::destroy { .. } - | pallet_uniques::Call::force_asset_status { .. } + | pallet_uniques::Call::force_item_status { .. } | pallet_uniques::Call::force_create { .. } - | pallet_uniques::Call::freeze_class { .. } + | pallet_uniques::Call::freeze_collection { .. } | pallet_uniques::Call::mint { .. } | pallet_uniques::Call::redeposit { .. } - | pallet_uniques::Call::set_class_metadata { .. } + | pallet_uniques::Call::set_collection_metadata { .. } | pallet_uniques::Call::set_metadata { .. } - | pallet_uniques::Call::thaw_class { .. } + | pallet_uniques::Call::thaw_collection { .. } | pallet_uniques::Call::transfer { .. } | pallet_uniques::Call::transfer_ownership { .. } => { return false; @@ -843,8 +843,8 @@ impl cumulus_pallet_parachain_system::Config for Runtime { } parameter_types! { - pub const ClassDeposit: Balance = 100 * DOLLARS; - pub const InstanceDeposit: Balance = 1 * DOLLARS; + pub const CollectionDeposit: Balance = 100 * DOLLARS; + pub const ItemDeposit: Balance = 1 * DOLLARS; pub const KeyLimit: u32 = 32; pub const ValueLimit: u32 = 256; pub const StringLimit: u32 = 50; @@ -858,8 +858,8 @@ impl pallet_uniques::Config for Runtime { type ForceOrigin = EnsureRoot; type CreateOrigin = AsEnsureOriginWithArg>; type Locker = (); - type CollectionDeposit = ClassDeposit; - type ItemDeposit = InstanceDeposit; + type CollectionDeposit = CollectionDeposit; + type ItemDeposit = ItemDeposit; type MetadataDepositBase = MetadataDepositBase; type AttributeDepositBase = MetadataDepositBase; type DepositPerByte = MetadataDepositPerByte;