fix: Complete snowbridge pezpallet rebrand and critical bug fixes

- snowbridge-pezpallet-* → pezsnowbridge-pezpallet-* (201 refs)
- pallet/ directories → pezpallet/ (4 locations)
- Fixed pezpallet.rs self-include recursion bug
- Fixed sc-chain-spec hardcoded crate name in derive macro
- Reverted .pezpallet_by_name() to .pallet_by_name() (subxt API)
- Added BizinikiwiConfig type alias for zombienet tests
- Deleted obsolete session state files

Verified: pezsnowbridge-pezpallet-*, pezpallet-staking,
pezpallet-staking-async, pezframe-benchmarking-cli all pass cargo check
This commit is contained in:
2025-12-16 09:57:23 +03:00
parent eea003e14d
commit 3139ffa25e
3022 changed files with 42157 additions and 23579 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ edition.workspace = true
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
description = "FRAME NFTs pallet"
description = "FRAME NFTs pezpallet"
readme = "README.md"
documentation = "https://docs.rs/pezpallet-nfts"
+7 -7
View File
@@ -1,10 +1,10 @@
# NFTs pallet
# NFTs pezpallet
A pallet for dealing with non-fungible assets.
A pezpallet for dealing with non-fungible assets.
## Overview
The NFTs pallet provides functionality for non-fungible tokens' management, including:
The NFTs pezpallet provides functionality for non-fungible tokens' management, including:
* Collection Creation
* NFT Minting
@@ -14,10 +14,10 @@ The NFTs pallet provides functionality for non-fungible tokens' management, incl
* NFT Burning
To use it in your runtime, you need to implement
[`nfts::Config`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_nfts/pallet/trait.Config.html).
[`nfts::Config`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_nfts/pezpallet/trait.Config.html).
The supported dispatchable functions are documented in the
[`nfts::Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_nfts/pallet/enum.Call.html) enum.
[`nfts::Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_nfts/pezpallet/enum.Call.html) enum.
### Terminology
@@ -33,7 +33,7 @@ The supported dispatchable functions are documented in the
### Goals
The NFTs pallet in Bizinikiwi is designed to make the following possible:
The NFTs pezpallet in Bizinikiwi is designed to make the following possible:
* Allow accounts to permissionlessly create nft collections.
* Allow a named (permissioned) account to mint and burn unique items within a collection.
@@ -96,7 +96,7 @@ The NFTs pallet in Bizinikiwi is designed to make the following possible:
* `force_collection_config`: Change collection's config.
* `force_set_attribute`: Set an attribute.
Please refer to the [`Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_nfts/pallet/enum.Call.html) enum and
Please refer to the [`Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_nfts/pezpallet/enum.Call.html) enum and
its associated variants for documentation on each function.
## Related Modules
@@ -6,7 +6,7 @@ edition.workspace = true
license = "Apache-2.0"
homepage.workspace = true
repository.workspace = true
description = "Runtime API for the FRAME NFTs pallet."
description = "Runtime API for the FRAME NFTs pezpallet."
readme = "README.md"
documentation = "https://docs.rs/pezpallet-nfts-runtime-api"
@@ -1,3 +1,3 @@
RPC runtime API for the FRAME NFTs pallet.
RPC runtime API for the FRAME NFTs pezpallet.
License: Apache-2.0
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Runtime API definition for the FRAME NFTs pallet.
//! Runtime API definition for the FRAME NFTs pezpallet.
#![cfg_attr(not(feature = "std"), no_std)]
+3 -3
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Nfts pallet benchmarking.
//! Nfts pezpallet benchmarking.
#![cfg(feature = "runtime-benchmarks")]
@@ -32,7 +32,7 @@ use pezframe_support::{
use pezframe_system::RawOrigin as SystemOrigin;
use pezsp_runtime::traits::{Bounded, One};
use crate::Pallet as Nfts;
use crate::Pezpallet as Nfts;
const SEED: u32 = 0;
@@ -190,7 +190,7 @@ fn add_collection_attribute<T: Config<I>, I: 'static>(
}
fn assert_last_event<T: Config<I>, I: 'static>(generic_event: <T as Config<I>>::RuntimeEvent) {
let events = pezframe_system::Pallet::<T>::events();
let events = pezframe_system::Pezpallet::<T>::events();
let system_event: <T as pezframe_system::Config>::RuntimeEvent = generic_event.into();
// compare to the last event record
let pezframe_system::EventRecord { event, .. } = &events[events.len() - 1];
@@ -21,7 +21,7 @@ use crate::*;
use alloc::vec::Vec;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Get the owner of the item, if the item exists.
pub fn owner(collection: T::CollectionId, item: T::ItemId) -> Option<T::AccountId> {
Item::<T, I>::get(collection, item).map(|i| i.owner)
@@ -15,14 +15,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! This module contains helper functions for the approval logic implemented in the NFTs pallet.
//! This module contains helper functions for the approval logic implemented in the NFTs pezpallet.
//! The bitflag [`PalletFeature::Approvals`] needs to be set in [`Config::Features`] for NFTs
//! to have the functionality defined in this module.
use crate::*;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Approves the transfer of an item to a delegate.
///
/// This function is used to approve the transfer of the specified `item` in the `collection` to
@@ -16,7 +16,7 @@
// limitations under the License.
//! This module contains helper functions for performing atomic swaps implemented in the NFTs
//! pallet.
//! pezpallet.
//! The bitflag [`PalletFeature::Swaps`] needs to be set in [`Config::Features`] for NFTs
//! to have the functionality defined in this module.
@@ -26,7 +26,7 @@ use pezframe_support::{
traits::{Currency, ExistenceRequirement::KeepAlive},
};
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Creates a new swap offer for the specified item.
///
/// This function is used to create a new swap offer for the specified item. The `caller`
@@ -16,14 +16,14 @@
// limitations under the License.
//! This module contains helper methods to configure attributes for items and collections in the
//! NFTs pallet.
//! NFTs pezpallet.
//! The bitflag [`PalletFeature::Attributes`] needs to be set in [`Config::Features`] for NFTs
//! to have the functionality defined in this module.
use crate::*;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Sets the attribute of an item or a collection.
///
/// This function is used to set an attribute for an item or a collection. It checks the
@@ -508,7 +508,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
/// # Errors
///
/// This function returns an [`IncorrectData`](crate::Error::IncorrectData) error if the
/// provided pallet attribute is too long.
/// provided pezpallet attribute is too long.
pub fn has_system_attribute(
collection: &T::CollectionId,
item: &T::ItemId,
@@ -517,7 +517,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let attribute = (
&collection,
Some(item),
AttributeNamespace::Pallet,
AttributeNamespace::Pezpallet,
&Self::construct_attribute_key(attribute_key.encode())?,
);
Ok(Attribute::<T, I>::contains_key(attribute))
@@ -16,7 +16,7 @@
// limitations under the License.
//! This module contains helper functions to perform the buy and sell functionalities of the NFTs
//! pallet.
//! pezpallet.
//! The bitflag [`PalletFeature::Trading`] needs to be set in the [`Config::Features`] for NFTs
//! to have the functionality defined in this module.
@@ -26,7 +26,7 @@ use pezframe_support::{
traits::{Currency, ExistenceRequirement, ExistenceRequirement::KeepAlive},
};
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Pays the specified tips to the corresponding receivers.
///
/// This function is used to pay tips from the `sender` account to multiple receivers. The tips
@@ -16,12 +16,12 @@
// limitations under the License.
//! This module contains helper methods to perform functionality associated with creating and
//! destroying collections for the NFTs pallet.
//! destroying collections for the NFTs pezpallet.
use crate::*;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Create a new collection with the given `collection`, `owner`, `admin`, `config`, `deposit`,
/// and `event`.
///
@@ -16,12 +16,12 @@
// limitations under the License.
//! This module contains helper methods to perform functionality associated with minting and burning
//! items for the NFTs pallet.
//! items for the NFTs pezpallet.
use crate::*;
use pezframe_support::{pezpallet_prelude::*, traits::ExistenceRequirement};
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Mint a new unique item with the given `collection`, `item`, and other minting configuration
/// details.
///
@@ -16,12 +16,12 @@
// limitations under the License.
//! This module contains helper methods to configure locks on collections and items for the NFTs
//! pallet.
//! pezpallet.
use crate::*;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Locks a collection with specified settings.
///
/// The origin must be the owner of the collection to lock it. This function disables certain
@@ -21,7 +21,7 @@ use crate::*;
use alloc::vec::Vec;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Sets the metadata for a specific item within a collection.
///
/// - `maybe_check_origin`: An optional account ID that is allowed to set the metadata. If
@@ -21,7 +21,7 @@ use crate::*;
use alloc::{collections::btree_map::BTreeMap, vec::Vec};
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Set the team roles for a specific collection.
///
/// - `maybe_check_owner`: An optional account ID used to check ownership permission. If `None`,
@@ -15,12 +15,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! This module provides helper methods to configure collection settings for the NFTs pallet.
//! This module provides helper methods to configure collection settings for the NFTs pezpallet.
use crate::*;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Forcefully change the configuration of a collection.
///
/// - `collection`: The ID of the collection for which to update the configuration.
@@ -160,12 +160,12 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
Ok(collection_config.mint_settings.default_item_settings)
}
/// Check if a specified pallet feature is enabled.
/// Check if a specified pezpallet feature is enabled.
///
/// - `feature`: The feature to check.
///
/// This function checks if the given `feature` is enabled in the runtime using the
/// pallet's `T::Features::get()` function. It returns `true` if the feature is enabled,
/// pezpallet's `T::Features::get()` function. It returns `true` if the feature is enabled,
/// otherwise it returns `false`.
pub(crate) fn is_pallet_feature_enabled(feature: PalletFeature) -> bool {
let features = T::Features::get();
@@ -16,12 +16,12 @@
// limitations under the License.
//! This module contains helper methods to perform the transfer functionalities
//! of the NFTs pallet.
//! of the NFTs pezpallet.
use crate::*;
use pezframe_support::pezpallet_prelude::*;
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Transfer an NFT to the specified destination account.
///
/// - `collection`: The ID of the collection to which the NFT belongs.
@@ -153,7 +153,7 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
details.owner = new_owner.clone();
OwnershipAcceptance::<T, I>::remove(&new_owner);
pezframe_system::Pallet::<T>::dec_consumers(&new_owner);
pezframe_system::Pezpallet::<T>::dec_consumers(&new_owner);
// Emit `OwnerChanged` event.
Self::deposit_event(Event::OwnerChanged { collection, new_owner });
@@ -176,10 +176,10 @@ impl<T: Config<I>, I: 'static> Pallet<T, I> {
let exists = OwnershipAcceptance::<T, I>::contains_key(&who);
match (exists, maybe_collection.is_some()) {
(false, true) => {
pezframe_system::Pallet::<T>::inc_consumers(&who)?;
pezframe_system::Pezpallet::<T>::inc_consumers(&who)?;
},
(true, false) => {
pezframe_system::Pallet::<T>::dec_consumers(&who);
pezframe_system::Pezpallet::<T>::dec_consumers(&who);
},
_ => {},
}
@@ -26,7 +26,7 @@ use pezframe_support::{
};
use pezsp_runtime::{DispatchError, DispatchResult};
impl<T: Config<I>, I: 'static> Inspect<<T as SystemConfig>::AccountId> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> Inspect<<T as SystemConfig>::AccountId> for Pezpallet<T, I> {
type ItemId = T::ItemId;
type CollectionId = T::CollectionId;
@@ -88,7 +88,7 @@ impl<T: Config<I>, I: 'static> Inspect<<T as SystemConfig>::AccountId> for Palle
item: Option<&Self::ItemId>,
key: &[u8],
) -> Option<Vec<u8>> {
let namespace = AttributeNamespace::Pallet;
let namespace = AttributeNamespace::Pezpallet;
let key = BoundedSlice::<_, _>::try_from(key).ok()?;
Attribute::<T, I>::get((collection, item, namespace, key)).map(|a| a.0.into())
}
@@ -136,7 +136,7 @@ impl<T: Config<I>, I: 'static> Inspect<<T as SystemConfig>::AccountId> for Palle
}
}
impl<T: Config<I>, I: 'static> InspectRole<<T as SystemConfig>::AccountId> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> InspectRole<<T as SystemConfig>::AccountId> for Pezpallet<T, I> {
fn is_issuer(collection: &Self::CollectionId, who: &<T as SystemConfig>::AccountId) -> bool {
Self::has_role(collection, who, CollectionRole::Issuer)
}
@@ -149,7 +149,7 @@ impl<T: Config<I>, I: 'static> InspectRole<<T as SystemConfig>::AccountId> for P
}
impl<T: Config<I>, I: 'static> Create<<T as SystemConfig>::AccountId, CollectionConfigFor<T, I>>
for Pallet<T, I>
for Pezpallet<T, I>
{
/// Create a `collection` of nonfungible items to be owned by `who` and managed by `admin`.
fn create_collection(
@@ -186,7 +186,7 @@ impl<T: Config<I>, I: 'static> Create<<T as SystemConfig>::AccountId, Collection
/// incremental order for the collection IDs and is a replacement for the auto id creation.
///
///
/// SAFETY: This function can break the pallet if it is used in combination with the auto
/// SAFETY: This function can break the pezpallet if it is used in combination with the auto
/// increment functionality, as it can claim a value in the ID sequence.
fn create_collection_with_id(
collection: T::CollectionId,
@@ -211,7 +211,7 @@ impl<T: Config<I>, I: 'static> Create<<T as SystemConfig>::AccountId, Collection
}
}
impl<T: Config<I>, I: 'static> Destroy<<T as SystemConfig>::AccountId> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> Destroy<<T as SystemConfig>::AccountId> for Pezpallet<T, I> {
type DestroyWitness = DestroyWitness;
fn get_destroy_witness(collection: &Self::CollectionId) -> Option<DestroyWitness> {
@@ -227,7 +227,7 @@ impl<T: Config<I>, I: 'static> Destroy<<T as SystemConfig>::AccountId> for Palle
}
}
impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemConfig> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemConfig> for Pezpallet<T, I> {
fn mint_into(
collection: &Self::CollectionId,
item: &Self::ItemId,
@@ -273,7 +273,7 @@ impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemConfig
None,
*collection,
Some(*item),
AttributeNamespace::Pallet,
AttributeNamespace::Pezpallet,
Self::construct_attribute_key(key.to_vec())?,
Self::construct_attribute_value(value.to_vec())?,
)
@@ -301,7 +301,7 @@ impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemConfig
None,
*collection,
None,
AttributeNamespace::Pallet,
AttributeNamespace::Pezpallet,
Self::construct_attribute_key(key.to_vec())?,
Self::construct_attribute_value(value.to_vec())?,
)
@@ -357,7 +357,7 @@ impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemConfig
None,
*collection,
Some(*item),
AttributeNamespace::Pallet,
AttributeNamespace::Pezpallet,
Self::construct_attribute_key(key.to_vec())?,
)
}
@@ -377,7 +377,7 @@ impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemConfig
None,
*collection,
None,
AttributeNamespace::Pallet,
AttributeNamespace::Pezpallet,
Self::construct_attribute_key(key.to_vec())?,
)
}
@@ -407,7 +407,7 @@ impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId, ItemConfig
}
}
impl<T: Config<I>, I: 'static> Transfer<T::AccountId> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> Transfer<T::AccountId> for Pezpallet<T, I> {
fn transfer(
collection: &Self::CollectionId,
item: &Self::ItemId,
@@ -441,7 +441,7 @@ impl<T: Config<I>, I: 'static> Transfer<T::AccountId> for Pallet<T, I> {
}
}
impl<T: Config<I>, I: 'static> Trading<T::AccountId, ItemPrice<T, I>> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> Trading<T::AccountId, ItemPrice<T, I>> for Pezpallet<T, I> {
fn buy_item(
collection: &Self::CollectionId,
item: &Self::ItemId,
@@ -466,7 +466,7 @@ impl<T: Config<I>, I: 'static> Trading<T::AccountId, ItemPrice<T, I>> for Pallet
}
}
impl<T: Config<I>, I: 'static> InspectEnumerable<T::AccountId> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> InspectEnumerable<T::AccountId> for Pezpallet<T, I> {
type CollectionsIterator = KeyPrefixIterator<<T as Config<I>>::CollectionId>;
type ItemsIterator = KeyPrefixIterator<<T as Config<I>>::ItemId>;
type OwnedIterator =
+128 -128
View File
@@ -37,8 +37,8 @@ pub mod mock;
mod tests;
mod common_functions;
/// A library providing the feature set of this pallet. It contains modules with helper methods that
/// perform storage updates and checks required by this pallet's dispatchables. To use pallet level
/// A library providing the feature set of this pezpallet. It contains modules with helper methods that
/// perform storage updates and checks required by this pezpallet's dispatchables. To use pezpallet level
/// features, make sure to set appropriate bitflags for [`Config::Features`] in your runtime
/// configuration trait.
mod features;
@@ -62,18 +62,18 @@ use pezsp_runtime::{
RuntimeDebug,
};
pub use pallet::*;
pub use pezpallet::*;
pub use types::*;
pub use weights::WeightInfo;
/// The log target of this pallet.
/// The log target of this pezpallet.
pub const LOG_TARGET: &'static str = "runtime::nfts";
/// A type alias for the account ID type used in the dispatchable functions of this pallet.
/// A type alias for the account ID type used in the dispatchable functions of this pezpallet.
type AccountIdLookupOf<T> = <<T as SystemConfig>::Lookup as StaticLookup>::Source;
#[pezframe_support::pallet]
pub mod pallet {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use super::*;
use pezframe_support::{pezpallet_prelude::*, traits::ExistenceRequirement};
use pezframe_system::{ensure_signed, pezpallet_prelude::OriginFor};
@@ -81,9 +81,9 @@ pub mod pallet {
/// The in-code storage version.
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T, I = ()>(PhantomData<(T, I)>);
#[pezpallet::pezpallet]
#[pezpallet::storage_version(STORAGE_VERSION)]
pub struct Pezpallet<T, I = ()>(PhantomData<(T, I)>);
#[cfg(feature = "runtime-benchmarks")]
pub trait BenchmarkHelper<CollectionId, ItemId, Public, AccountId, Signature> {
@@ -124,7 +124,7 @@ pub mod pallet {
}
}
#[pallet::config]
#[pezpallet::config]
/// The module configuration trait.
pub trait Config<I: 'static = ()>: pezframe_system::Config {
/// The overarching event type.
@@ -165,60 +165,60 @@ pub mod pallet {
type Locker: Locker<Self::CollectionId, Self::ItemId>;
/// The basic amount of funds that must be reserved for collection.
#[pallet::constant]
#[pezpallet::constant]
type CollectionDeposit: Get<DepositBalanceOf<Self, I>>;
/// The basic amount of funds that must be reserved for an item.
#[pallet::constant]
#[pezpallet::constant]
type ItemDeposit: Get<DepositBalanceOf<Self, I>>;
/// The basic amount of funds that must be reserved when adding metadata to your item.
#[pallet::constant]
#[pezpallet::constant]
type MetadataDepositBase: Get<DepositBalanceOf<Self, I>>;
/// The basic amount of funds that must be reserved when adding an attribute to an item.
#[pallet::constant]
#[pezpallet::constant]
type AttributeDepositBase: Get<DepositBalanceOf<Self, I>>;
/// The additional funds that must be reserved for the number of bytes store in metadata,
/// either "normal" metadata or attribute metadata.
#[pallet::constant]
#[pezpallet::constant]
type DepositPerByte: Get<DepositBalanceOf<Self, I>>;
/// The maximum length of data stored on-chain.
#[pallet::constant]
#[pezpallet::constant]
type StringLimit: Get<u32>;
/// The maximum length of an attribute key.
#[pallet::constant]
#[pezpallet::constant]
type KeyLimit: Get<u32>;
/// The maximum length of an attribute value.
#[pallet::constant]
#[pezpallet::constant]
type ValueLimit: Get<u32>;
/// The maximum approvals an item could have.
#[pallet::constant]
#[pezpallet::constant]
type ApprovalsLimit: Get<u32>;
/// The maximum attributes approvals an item could have.
#[pallet::constant]
#[pezpallet::constant]
type ItemAttributesApprovalsLimit: Get<u32>;
/// The max number of tips a user could send.
#[pallet::constant]
#[pezpallet::constant]
type MaxTips: Get<u32>;
/// The max duration in blocks for deadlines.
#[pallet::constant]
#[pezpallet::constant]
type MaxDeadlineDuration: Get<BlockNumberFor<Self, I>>;
/// The max number of attributes a user could set per call.
#[pallet::constant]
#[pezpallet::constant]
type MaxAttributesPerCall: Get<u32>;
/// Disables some of pallet's features.
#[pallet::constant]
/// Disables some of pezpallet's features.
#[pezpallet::constant]
type Features: Get<PalletFeatures>;
/// Off-Chain signature type.
@@ -241,15 +241,15 @@ pub mod pallet {
Self::OffchainSignature,
>;
/// Weight information for extrinsics in this pallet.
/// Weight information for extrinsics in this pezpallet.
type WeightInfo: WeightInfo;
/// Provider for the block number. Normally this is the `pezframe_system` pallet.
/// Provider for the block number. Normally this is the `pezframe_system` pezpallet.
type BlockNumberProvider: BlockNumberProvider;
}
/// Details of a collection.
#[pallet::storage]
#[pezpallet::storage]
pub type Collection<T: Config<I>, I: 'static = ()> = StorageMap<
_,
Blake2_128Concat,
@@ -258,13 +258,13 @@ pub mod pallet {
>;
/// The collection, if any, of which an account is willing to take ownership.
#[pallet::storage]
#[pezpallet::storage]
pub type OwnershipAcceptance<T: Config<I>, I: 'static = ()> =
StorageMap<_, Blake2_128Concat, T::AccountId, T::CollectionId>;
/// The items held by any given account; set out this way so that items owned by a single
/// account can be enumerated.
#[pallet::storage]
#[pezpallet::storage]
pub type Account<T: Config<I>, I: 'static = ()> = StorageNMap<
_,
(
@@ -278,7 +278,7 @@ pub mod pallet {
/// The collections owned by any given account; set out this way so that collections owned by
/// a single account can be enumerated.
#[pallet::storage]
#[pezpallet::storage]
pub type CollectionAccount<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -290,7 +290,7 @@ pub mod pallet {
>;
/// The items in existence and their ownership details.
#[pallet::storage]
#[pezpallet::storage]
/// Stores collection roles as per account.
pub type CollectionRoleOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
@@ -303,7 +303,7 @@ pub mod pallet {
>;
/// The items in existence and their ownership details.
#[pallet::storage]
#[pezpallet::storage]
pub type Item<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -315,7 +315,7 @@ pub mod pallet {
>;
/// Metadata of a collection.
#[pallet::storage]
#[pezpallet::storage]
pub type CollectionMetadataOf<T: Config<I>, I: 'static = ()> = StorageMap<
_,
Blake2_128Concat,
@@ -325,7 +325,7 @@ pub mod pallet {
>;
/// Metadata of an item.
#[pallet::storage]
#[pezpallet::storage]
pub type ItemMetadataOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -337,7 +337,7 @@ pub mod pallet {
>;
/// Attributes of a collection.
#[pallet::storage]
#[pezpallet::storage]
pub type Attribute<T: Config<I>, I: 'static = ()> = StorageNMap<
_,
(
@@ -351,7 +351,7 @@ pub mod pallet {
>;
/// A price of an item.
#[pallet::storage]
#[pezpallet::storage]
pub type ItemPriceOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -363,7 +363,7 @@ pub mod pallet {
>;
/// Item attribute approvals.
#[pallet::storage]
#[pezpallet::storage]
pub type ItemAttributesApprovalsOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -376,12 +376,12 @@ pub mod pallet {
/// Stores the `CollectionId` that is going to be used for the next collection.
/// This gets incremented whenever a new collection is created.
#[pallet::storage]
#[pezpallet::storage]
pub type NextCollectionId<T: Config<I>, I: 'static = ()> =
StorageValue<_, T::CollectionId, OptionQuery>;
/// Handles all the pending swaps.
#[pallet::storage]
#[pezpallet::storage]
pub type PendingSwapOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -398,12 +398,12 @@ pub mod pallet {
>;
/// Config of a collection.
#[pallet::storage]
#[pezpallet::storage]
pub type CollectionConfigOf<T: Config<I>, I: 'static = ()> =
StorageMap<_, Blake2_128Concat, T::CollectionId, CollectionConfigFor<T, I>, OptionQuery>;
/// Config of an item.
#[pallet::storage]
#[pezpallet::storage]
pub type ItemConfigOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
Blake2_128Concat,
@@ -414,8 +414,8 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
#[pezpallet::event]
#[pezpallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config<I>, I: 'static = ()> {
/// A `collection` was created.
Created { collection: T::CollectionId, creator: T::AccountId, owner: T::AccountId },
@@ -586,7 +586,7 @@ pub mod pallet {
item: T::ItemId,
namespace: AttributeNamespace<T::AccountId>,
},
/// A new attribute in the `Pallet` namespace was set for the `collection` or an `item`
/// A new attribute in the `Pezpallet` namespace was set for the `collection` or an `item`
/// within that `collection`.
PalletAttributeSet {
collection: T::CollectionId,
@@ -596,7 +596,7 @@ pub mod pallet {
},
}
#[pallet::error]
#[pezpallet::error]
pub enum Error<T, I = ()> {
/// The signing account has no permission to do the operation.
NoPermission,
@@ -690,8 +690,8 @@ pub mod pallet {
WitnessRequired,
}
#[pallet::call]
impl<T: Config<I>, I: 'static> Pallet<T, I> {
#[pezpallet::call]
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Issue a new collection of non-fungible items from a public origin.
///
/// This new collection has no items initially and its owner is the origin.
@@ -707,8 +707,8 @@ pub mod pallet {
/// Emits `Created` event when successful.
///
/// Weight: `O(1)`
#[pallet::call_index(0)]
#[pallet::weight(T::WeightInfo::create())]
#[pezpallet::call_index(0)]
#[pezpallet::weight(T::WeightInfo::create())]
pub fn create(
origin: OriginFor<T>,
admin: AccountIdLookupOf<T>,
@@ -755,8 +755,8 @@ pub mod pallet {
/// Emits `ForceCreated` event when successful.
///
/// Weight: `O(1)`
#[pallet::call_index(1)]
#[pallet::weight(T::WeightInfo::force_create())]
#[pezpallet::call_index(1)]
#[pezpallet::weight(T::WeightInfo::force_create())]
pub fn force_create(
origin: OriginFor<T>,
owner: AccountIdLookupOf<T>,
@@ -799,8 +799,8 @@ pub mod pallet {
/// - `m = witness.item_metadatas`
/// - `c = witness.item_configs`
/// - `a = witness.attributes`
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::destroy(
#[pezpallet::call_index(2)]
#[pezpallet::weight(T::WeightInfo::destroy(
witness.item_metadatas,
witness.item_configs,
witness.attributes,
@@ -839,8 +839,8 @@ pub mod pallet {
/// Emits `Issued` event when successful.
///
/// Weight: `O(1)`
#[pallet::call_index(3)]
#[pallet::weight(T::WeightInfo::mint())]
#[pezpallet::call_index(3)]
#[pezpallet::weight(T::WeightInfo::mint())]
pub fn mint(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -895,7 +895,7 @@ pub mod pallet {
let key = (
&collection_id,
Some(owned_item),
AttributeNamespace::Pallet,
AttributeNamespace::Pezpallet,
&Self::construct_attribute_key(pezpallet_attribute.encode())?,
);
let already_claimed = Attribute::<T, I>::contains_key(key.clone());
@@ -950,8 +950,8 @@ pub mod pallet {
/// Emits `Issued` event when successful.
///
/// Weight: `O(1)`
#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::force_mint())]
#[pezpallet::call_index(4)]
#[pezpallet::weight(T::WeightInfo::force_mint())]
pub fn force_mint(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -984,8 +984,8 @@ pub mod pallet {
/// Emits `Burned`.
///
/// Weight: `O(1)`
#[pallet::call_index(5)]
#[pallet::weight(T::WeightInfo::burn())]
#[pezpallet::call_index(5)]
#[pezpallet::weight(T::WeightInfo::burn())]
pub fn burn(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1017,8 +1017,8 @@ pub mod pallet {
/// Emits `Transferred`.
///
/// Weight: `O(1)`
#[pallet::call_index(6)]
#[pallet::weight(T::WeightInfo::transfer())]
#[pezpallet::call_index(6)]
#[pezpallet::weight(T::WeightInfo::transfer())]
pub fn transfer(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1058,8 +1058,8 @@ pub mod pallet {
/// is not permitted to call it.
///
/// Weight: `O(items.len())`
#[pallet::call_index(7)]
#[pallet::weight(T::WeightInfo::redeposit(items.len() as u32))]
#[pezpallet::call_index(7)]
#[pezpallet::weight(T::WeightInfo::redeposit(items.len() as u32))]
pub fn redeposit(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1118,8 +1118,8 @@ pub mod pallet {
/// Emits `ItemTransferLocked`.
///
/// Weight: `O(1)`
#[pallet::call_index(8)]
#[pallet::weight(T::WeightInfo::lock_item_transfer())]
#[pezpallet::call_index(8)]
#[pezpallet::weight(T::WeightInfo::lock_item_transfer())]
pub fn lock_item_transfer(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1139,8 +1139,8 @@ pub mod pallet {
/// Emits `ItemTransferUnlocked`.
///
/// Weight: `O(1)`
#[pallet::call_index(9)]
#[pallet::weight(T::WeightInfo::unlock_item_transfer())]
#[pezpallet::call_index(9)]
#[pezpallet::weight(T::WeightInfo::unlock_item_transfer())]
pub fn unlock_item_transfer(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1162,8 +1162,8 @@ pub mod pallet {
/// Emits `CollectionLocked`.
///
/// Weight: `O(1)`
#[pallet::call_index(10)]
#[pallet::weight(T::WeightInfo::lock_collection())]
#[pezpallet::call_index(10)]
#[pezpallet::weight(T::WeightInfo::lock_collection())]
pub fn lock_collection(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1184,8 +1184,8 @@ pub mod pallet {
/// Emits `OwnerChanged`.
///
/// Weight: `O(1)`
#[pallet::call_index(11)]
#[pallet::weight(T::WeightInfo::transfer_ownership())]
#[pezpallet::call_index(11)]
#[pezpallet::weight(T::WeightInfo::transfer_ownership())]
pub fn transfer_ownership(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1212,8 +1212,8 @@ pub mod pallet {
/// Emits `TeamChanged`.
///
/// Weight: `O(1)`
#[pallet::call_index(12)]
#[pallet::weight(T::WeightInfo::set_team())]
#[pezpallet::call_index(12)]
#[pezpallet::weight(T::WeightInfo::set_team())]
pub fn set_team(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1240,8 +1240,8 @@ pub mod pallet {
/// Emits `OwnerChanged`.
///
/// Weight: `O(1)`
#[pallet::call_index(13)]
#[pallet::weight(T::WeightInfo::force_collection_owner())]
#[pezpallet::call_index(13)]
#[pezpallet::weight(T::WeightInfo::force_collection_owner())]
pub fn force_collection_owner(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1262,8 +1262,8 @@ pub mod pallet {
/// Emits `CollectionConfigChanged`.
///
/// Weight: `O(1)`
#[pallet::call_index(14)]
#[pallet::weight(T::WeightInfo::force_collection_config())]
#[pezpallet::call_index(14)]
#[pezpallet::weight(T::WeightInfo::force_collection_config())]
pub fn force_collection_config(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1287,8 +1287,8 @@ pub mod pallet {
/// Emits `TransferApproved` on success.
///
/// Weight: `O(1)`
#[pallet::call_index(15)]
#[pallet::weight(T::WeightInfo::approve_transfer())]
#[pezpallet::call_index(15)]
#[pezpallet::weight(T::WeightInfo::approve_transfer())]
pub fn approve_transfer(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1323,8 +1323,8 @@ pub mod pallet {
/// Emits `ApprovalCancelled` on success.
///
/// Weight: `O(1)`
#[pallet::call_index(16)]
#[pallet::weight(T::WeightInfo::cancel_approval())]
#[pezpallet::call_index(16)]
#[pezpallet::weight(T::WeightInfo::cancel_approval())]
pub fn cancel_approval(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1351,8 +1351,8 @@ pub mod pallet {
/// Emits `AllApprovalsCancelled` on success.
///
/// Weight: `O(1)`
#[pallet::call_index(17)]
#[pallet::weight(T::WeightInfo::clear_all_transfer_approvals())]
#[pezpallet::call_index(17)]
#[pezpallet::weight(T::WeightInfo::clear_all_transfer_approvals())]
pub fn clear_all_transfer_approvals(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1381,8 +1381,8 @@ pub mod pallet {
/// Emits `ItemPropertiesLocked`.
///
/// Weight: `O(1)`
#[pallet::call_index(18)]
#[pallet::weight(T::WeightInfo::lock_item_properties())]
#[pezpallet::call_index(18)]
#[pezpallet::weight(T::WeightInfo::lock_item_properties())]
pub fn lock_item_properties(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1424,8 +1424,8 @@ pub mod pallet {
/// Emits `AttributeSet`.
///
/// Weight: `O(1)`
#[pallet::call_index(19)]
#[pallet::weight(T::WeightInfo::set_attribute())]
#[pezpallet::call_index(19)]
#[pezpallet::weight(T::WeightInfo::set_attribute())]
pub fn set_attribute(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1460,8 +1460,8 @@ pub mod pallet {
/// Emits `AttributeSet`.
///
/// Weight: `O(1)`
#[pallet::call_index(20)]
#[pallet::weight(T::WeightInfo::force_set_attribute())]
#[pezpallet::call_index(20)]
#[pezpallet::weight(T::WeightInfo::force_set_attribute())]
pub fn force_set_attribute(
origin: OriginFor<T>,
set_as: Option<T::AccountId>,
@@ -1490,8 +1490,8 @@ pub mod pallet {
/// Emits `AttributeCleared`.
///
/// Weight: `O(1)`
#[pallet::call_index(21)]
#[pallet::weight(T::WeightInfo::clear_attribute())]
#[pezpallet::call_index(21)]
#[pezpallet::weight(T::WeightInfo::clear_attribute())]
pub fn clear_attribute(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1514,8 +1514,8 @@ pub mod pallet {
/// - `delegate`: The account to delegate permission to change attributes of the item.
///
/// Emits `ItemAttributesApprovalAdded` on success.
#[pallet::call_index(22)]
#[pallet::weight(T::WeightInfo::approve_item_attributes())]
#[pezpallet::call_index(22)]
#[pezpallet::weight(T::WeightInfo::approve_item_attributes())]
pub fn approve_item_attributes(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1537,8 +1537,8 @@ pub mod pallet {
/// - `delegate`: The previously approved account to remove.
///
/// Emits `ItemAttributesApprovalRemoved` on success.
#[pallet::call_index(23)]
#[pallet::weight(T::WeightInfo::cancel_item_attributes_approval(
#[pezpallet::call_index(23)]
#[pezpallet::weight(T::WeightInfo::cancel_item_attributes_approval(
witness.account_attributes
))]
pub fn cancel_item_attributes_approval(
@@ -1569,8 +1569,8 @@ pub mod pallet {
/// Emits `ItemMetadataSet`.
///
/// Weight: `O(1)`
#[pallet::call_index(24)]
#[pallet::weight(T::WeightInfo::set_metadata())]
#[pezpallet::call_index(24)]
#[pezpallet::weight(T::WeightInfo::set_metadata())]
pub fn set_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1596,8 +1596,8 @@ pub mod pallet {
/// Emits `ItemMetadataCleared`.
///
/// Weight: `O(1)`
#[pallet::call_index(25)]
#[pallet::weight(T::WeightInfo::clear_metadata())]
#[pezpallet::call_index(25)]
#[pezpallet::weight(T::WeightInfo::clear_metadata())]
pub fn clear_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1624,8 +1624,8 @@ pub mod pallet {
/// Emits `CollectionMetadataSet`.
///
/// Weight: `O(1)`
#[pallet::call_index(26)]
#[pallet::weight(T::WeightInfo::set_collection_metadata())]
#[pezpallet::call_index(26)]
#[pezpallet::weight(T::WeightInfo::set_collection_metadata())]
pub fn set_collection_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1649,8 +1649,8 @@ pub mod pallet {
/// Emits `CollectionMetadataCleared`.
///
/// Weight: `O(1)`
#[pallet::call_index(27)]
#[pallet::weight(T::WeightInfo::clear_collection_metadata())]
#[pezpallet::call_index(27)]
#[pezpallet::weight(T::WeightInfo::clear_collection_metadata())]
pub fn clear_collection_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1671,8 +1671,8 @@ pub mod pallet {
/// ownership transferal.
///
/// Emits `OwnershipAcceptanceChanged`.
#[pallet::call_index(28)]
#[pallet::weight(T::WeightInfo::set_accept_ownership())]
#[pezpallet::call_index(28)]
#[pezpallet::weight(T::WeightInfo::set_accept_ownership())]
pub fn set_accept_ownership(
origin: OriginFor<T>,
maybe_collection: Option<T::CollectionId>,
@@ -1690,8 +1690,8 @@ pub mod pallet {
/// - `max_supply`: The maximum number of items a collection could have.
///
/// Emits `CollectionMaxSupplySet` event when successful.
#[pallet::call_index(29)]
#[pallet::weight(T::WeightInfo::set_collection_max_supply())]
#[pezpallet::call_index(29)]
#[pezpallet::weight(T::WeightInfo::set_collection_max_supply())]
pub fn set_collection_max_supply(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1712,8 +1712,8 @@ pub mod pallet {
/// - `mint_settings`: The new mint settings.
///
/// Emits `CollectionMintSettingsUpdated` event when successful.
#[pallet::call_index(30)]
#[pallet::weight(T::WeightInfo::update_mint_settings())]
#[pezpallet::call_index(30)]
#[pezpallet::weight(T::WeightInfo::update_mint_settings())]
pub fn update_mint_settings(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1736,8 +1736,8 @@ pub mod pallet {
///
/// Emits `ItemPriceSet` on success if the price is not `None`.
/// Emits `ItemPriceRemoved` on success if the price is `None`.
#[pallet::call_index(31)]
#[pallet::weight(T::WeightInfo::set_price())]
#[pezpallet::call_index(31)]
#[pezpallet::weight(T::WeightInfo::set_price())]
pub fn set_price(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1759,8 +1759,8 @@ pub mod pallet {
/// - `bid_price`: The price the sender is willing to pay.
///
/// Emits `ItemBought` on success.
#[pallet::call_index(32)]
#[pallet::weight(T::WeightInfo::buy_item())]
#[pezpallet::call_index(32)]
#[pezpallet::weight(T::WeightInfo::buy_item())]
pub fn buy_item(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1778,8 +1778,8 @@ pub mod pallet {
/// - `tips`: Tips array.
///
/// Emits `TipSent` on every tip transfer.
#[pallet::call_index(33)]
#[pallet::weight(T::WeightInfo::pay_tips(tips.len() as u32))]
#[pezpallet::call_index(33)]
#[pezpallet::weight(T::WeightInfo::pay_tips(tips.len() as u32))]
pub fn pay_tips(
origin: OriginFor<T>,
tips: BoundedVec<ItemTipOf<T, I>, T::MaxTips>,
@@ -1804,8 +1804,8 @@ pub mod pallet {
/// after which the swap will expire.
///
/// Emits `SwapCreated` on success.
#[pallet::call_index(34)]
#[pallet::weight(T::WeightInfo::create_swap())]
#[pezpallet::call_index(34)]
#[pezpallet::weight(T::WeightInfo::create_swap())]
pub fn create_swap(
origin: OriginFor<T>,
offered_collection: T::CollectionId,
@@ -1836,8 +1836,8 @@ pub mod pallet {
/// - `item`: The item an owner wants to give.
///
/// Emits `SwapCancelled` on success.
#[pallet::call_index(35)]
#[pallet::weight(T::WeightInfo::cancel_swap())]
#[pezpallet::call_index(35)]
#[pezpallet::weight(T::WeightInfo::cancel_swap())]
pub fn cancel_swap(
origin: OriginFor<T>,
offered_collection: T::CollectionId,
@@ -1859,8 +1859,8 @@ pub mod pallet {
/// - `witness_price`: A price that was previously agreed on.
///
/// Emits `SwapClaimed` on success.
#[pallet::call_index(36)]
#[pallet::weight(T::WeightInfo::claim_swap())]
#[pezpallet::call_index(36)]
#[pezpallet::weight(T::WeightInfo::claim_swap())]
pub fn claim_swap(
origin: OriginFor<T>,
send_collection: T::CollectionId,
@@ -1893,8 +1893,8 @@ pub mod pallet {
/// Emits `Issued` on success.
/// Emits `AttributeSet` if the attributes were provided.
/// Emits `ItemMetadataSet` if the metadata was not empty.
#[pallet::call_index(37)]
#[pallet::weight(T::WeightInfo::mint_pre_signed(mint_data.attributes.len() as u32))]
#[pezpallet::call_index(37)]
#[pezpallet::weight(T::WeightInfo::mint_pre_signed(mint_data.attributes.len() as u32))]
pub fn mint_pre_signed(
origin: OriginFor<T>,
mint_data: Box<PreSignedMintOf<T, I>>,
@@ -1919,8 +1919,8 @@ pub mod pallet {
/// Emits `AttributeSet` for each provided attribute.
/// Emits `ItemAttributesApprovalAdded` if the approval wasn't set before.
/// Emits `PreSignedAttributesSet` on success.
#[pallet::call_index(38)]
#[pallet::weight(T::WeightInfo::set_attributes_pre_signed(data.attributes.len() as u32))]
#[pezpallet::call_index(38)]
#[pezpallet::weight(T::WeightInfo::set_attributes_pre_signed(data.attributes.len() as u32))]
pub fn set_attributes_pre_signed(
origin: OriginFor<T>,
data: PreSignedAttributesOf<T, I>,
+5 -5
View File
@@ -50,12 +50,12 @@ pub mod v1 {
}
}
/// A migration utility to update the storage version from v0 to v1 for the pallet.
/// A migration utility to update the storage version from v0 to v1 for the pezpallet.
pub struct MigrateToV1<T>(core::marker::PhantomData<T>);
impl<T: Config> OnRuntimeUpgrade for MigrateToV1<T> {
fn on_runtime_upgrade() -> Weight {
let in_code_version = Pallet::<T>::in_code_storage_version();
let on_chain_version = Pallet::<T>::on_chain_storage_version();
let in_code_version = Pezpallet::<T>::in_code_storage_version();
let on_chain_version = Pezpallet::<T>::on_chain_storage_version();
log::info!(
target: LOG_TARGET,
@@ -77,7 +77,7 @@ pub mod v1 {
Some(old_value.migrate_to_v1(item_configs))
});
in_code_version.put::<Pallet<T>>();
in_code_version.put::<Pezpallet<T>>();
log::info!(
target: LOG_TARGET,
@@ -112,7 +112,7 @@ pub mod v1 {
"the records count before and after the migration should be the same"
);
ensure!(Pallet::<T>::on_chain_storage_version() >= 1, "wrong storage version");
ensure!(Pezpallet::<T>::on_chain_storage_version() >= 1, "wrong storage version");
Ok(())
}
+2 -2
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Test environment for Nfts pallet.
//! Test environment for Nfts pezpallet.
use super::*;
use crate as pezpallet_nfts;
@@ -92,7 +92,7 @@ impl Config for Test {
type WeightInfo = ();
#[cfg(feature = "runtime-benchmarks")]
type Helper = ();
type BlockNumberProvider = pezframe_system::Pallet<Test>;
type BlockNumberProvider = pezframe_system::Pezpallet<Test>;
}
pub(crate) fn new_test_ext() -> pezsp_io::TestExternalities {
+5 -5
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Tests for Nfts pallet.
//! Tests for Nfts pezpallet.
use crate::{mock::*, Event, SystemConfig, *};
use enumflags2::BitFlags;
@@ -1014,7 +1014,7 @@ fn set_collection_system_attributes_should_work() {
&attribute_value
));
assert_eq!(attributes(0), vec![(None, AttributeNamespace::Pallet, bvec![0], bvec![0])]);
assert_eq!(attributes(0), vec![(None, AttributeNamespace::Pezpallet, bvec![0], bvec![0])]);
assert_eq!(
<Nfts as Inspect<AccountIdOf<Test>>>::system_attribute(
@@ -1052,10 +1052,10 @@ fn set_collection_system_attributes_should_work() {
assert_eq!(
attributes(collection_id),
[
(None, AttributeNamespace::Pallet, bvec![0], bvec![0]),
(None, AttributeNamespace::Pezpallet, bvec![0], bvec![0]),
(
None,
AttributeNamespace::Pallet,
AttributeNamespace::Pezpallet,
bvec![
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0
@@ -1406,7 +1406,7 @@ fn validate_deposit_required_setting() {
(Some(0), AttributeNamespace::CollectionOwner, bvec![0], bvec![0]),
(Some(0), AttributeNamespace::ItemOwner, bvec![1], bvec![0]),
(Some(0), AttributeNamespace::Account(account(3)), bvec![2], bvec![0]),
(Some(0), AttributeNamespace::Pallet, bvec![3], bvec![0]),
(Some(0), AttributeNamespace::Pezpallet, bvec![3], bvec![0]),
]
);
assert_eq!(Balances::reserved_balance(account(1)), 0);
+4 -4
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! This module contains various basic types and data structures used in the NFTs pallet.
//! This module contains various basic types and data structures used in the NFTs pezpallet.
use super::*;
use crate::macros::*;
@@ -160,7 +160,7 @@ pub struct ItemDetails<AccountId, Deposit, Approvals> {
pub owner: AccountId,
/// The approved transferrer of this item, if one is set.
pub approvals: Approvals,
/// The amount held in the pallet's default account for this item. Free-hold items will have
/// The amount held in the pezpallet's default account for this item. Free-hold items will have
/// this as zero.
pub deposit: Deposit,
}
@@ -411,8 +411,8 @@ impl<Price, BlockNumber, CollectionId> Default for MintSettings<Price, BlockNumb
MaxEncodedLen,
)]
pub enum AttributeNamespace<AccountId> {
/// An attribute was set by the pallet.
Pallet,
/// An attribute was set by the pezpallet.
Pezpallet,
/// An attribute was set by collection's owner.
CollectionOwner,
/// An attribute was set by item's owner.
+2 -2
View File
@@ -44,10 +44,10 @@
// frame-omni-bencher
// v1
// benchmark
// pallet
// pezpallet
// --extrinsic=*
// --runtime=target/production/wbuild/pez-kitchensink-runtime/pez_kitchensink_runtime.wasm
// --pallet=pezpallet_nfts
// --pezpallet=pezpallet_nfts
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/nfts/src/weights.rs
// --wasm-execution=compiled