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 NFT asset management pallet"
description = "FRAME NFT asset management pezpallet"
readme = "README.md"
documentation = "https://docs.rs/pezpallet-uniques"
+4 -4
View File
@@ -14,10 +14,10 @@ The Uniques module provides functionality for non-fungible tokens' management, i
* Item Burning
To use it in your runtime, you need to implement
[`uniques::Config`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_uniques/pallet/trait.Config.html).
[`uniques::Config`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_uniques/pezpallet/trait.Config.html).
The supported dispatchable functions are documented in the
[`uniques::Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_uniques/pallet/enum.Call.html) enum.
[`uniques::Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_uniques/pezpallet/enum.Call.html) enum.
### Terminology
@@ -30,7 +30,7 @@ The supported dispatchable functions are documented in the
### Goals
The Uniques pallet in Bizinikiwi is designed to make the following possible:
The Uniques 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.
@@ -70,7 +70,7 @@ The Uniques pallet in Bizinikiwi is designed to make the following possible:
* `force_create`: Create a new collection.
* `force_asset_status`: Alter the underlying characteristics of a collection.
Please refer to the [`Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_uniques/pallet/enum.Call.html) enum
Please refer to the [`Call`](https://docs.pezkuwichain.io/bizinikiwi/master/pallet_uniques/pezpallet/enum.Call.html) enum
and its associated variants for documentation on each function.
## Related Modules
@@ -40,11 +40,11 @@ use pezsp_runtime::{DispatchError, DispatchResult};
pub struct Collection<PalletInstance>(PhantomData<PalletInstance>);
impl<T: Config<I>, I: 'static> AssetDefinition for Collection<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> AssetDefinition for Collection<Pezpallet<T, I>> {
type Id = T::CollectionId;
}
impl<T: Config<I>, I: 'static> Inspect<Owner<T::AccountId>> for Collection<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Inspect<Owner<T::AccountId>> for Collection<Pezpallet<T, I>> {
fn inspect(
collection: &Self::Id,
_ownership: Owner<T::AccountId>,
@@ -55,7 +55,7 @@ impl<T: Config<I>, I: 'static> Inspect<Owner<T::AccountId>> for Collection<Palle
}
}
impl<T: Config<I>, I: 'static> Inspect<Bytes> for Collection<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Inspect<Bytes> for Collection<Pezpallet<T, I>> {
fn inspect(collection: &Self::Id, _bytes: Bytes) -> Result<Vec<u8>, DispatchError> {
CollectionMetadataOf::<T, I>::get(collection)
.map(|m| m.data.into())
@@ -63,7 +63,7 @@ impl<T: Config<I>, I: 'static> Inspect<Bytes> for Collection<Pallet<T, I>> {
}
}
impl<'a, T: Config<I>, I: 'static> Inspect<Bytes<Attribute<'a>>> for Collection<Pallet<T, I>> {
impl<'a, T: Config<I>, I: 'static> Inspect<Bytes<Attribute<'a>>> for Collection<Pezpallet<T, I>> {
fn inspect(
collection: &Self::Id,
strategy: Bytes<Attribute>,
@@ -78,13 +78,13 @@ impl<'a, T: Config<I>, I: 'static> Inspect<Bytes<Attribute<'a>>> for Collection<
}
}
impl<T: Config<I>, I: 'static> Create<WithCollectionConfig<T, I>> for Collection<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Create<WithCollectionConfig<T, I>> for Collection<Pezpallet<T, I>> {
fn create(strategy: WithCollectionConfig<T, I>) -> Result<T::CollectionId, DispatchError> {
let WithConfig { config, extra: id_assignment } = strategy;
let collection = id_assignment.params;
let (ConfigValue(owner), ConfigValue(admin)) = config;
<Pallet<T, I>>::do_create_collection(
<Pezpallet<T, I>>::do_create_collection(
collection.clone(),
owner.clone(),
admin.clone(),
@@ -98,7 +98,7 @@ impl<T: Config<I>, I: 'static> Create<WithCollectionConfig<T, I>> for Collection
}
impl<T: Config<I>, I: 'static> Create<CheckOrigin<T::RuntimeOrigin, WithCollectionConfig<T, I>>>
for Collection<Pallet<T, I>>
for Collection<Pezpallet<T, I>>
{
fn create(
strategy: CheckOrigin<T::RuntimeOrigin, WithCollectionConfig<T, I>>,
@@ -124,16 +124,16 @@ impl<T: Config<I>, I: 'static> Create<CheckOrigin<T::RuntimeOrigin, WithCollecti
}
}
impl<T: Config<I>, I: 'static> Destroy<WithWitness<DestroyWitness>> for Collection<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Destroy<WithWitness<DestroyWitness>> for Collection<Pezpallet<T, I>> {
fn destroy(collection: &Self::Id, strategy: WithWitness<DestroyWitness>) -> DispatchResult {
let CheckState(witness, _) = strategy;
<Pallet<T, I>>::do_destroy_collection(collection.clone(), witness, None).map(|_witness| ())
<Pezpallet<T, I>>::do_destroy_collection(collection.clone(), witness, None).map(|_witness| ())
}
}
impl<T: Config<I>, I: 'static> Destroy<IfOwnedBy<T::AccountId, WithWitness<DestroyWitness>>>
for Collection<Pallet<T, I>>
for Collection<Pezpallet<T, I>>
{
fn destroy(
collection: &Self::Id,
@@ -141,13 +141,13 @@ impl<T: Config<I>, I: 'static> Destroy<IfOwnedBy<T::AccountId, WithWitness<Destr
) -> DispatchResult {
let CheckState(owner, CheckState(witness, _)) = strategy;
<Pallet<T, I>>::do_destroy_collection(collection.clone(), witness, Some(owner))
<Pezpallet<T, I>>::do_destroy_collection(collection.clone(), witness, Some(owner))
.map(|_witness| ())
}
}
impl<T: Config<I>, I: 'static> Destroy<CheckOrigin<T::RuntimeOrigin, WithWitness<DestroyWitness>>>
for Collection<Pallet<T, I>>
for Collection<Pezpallet<T, I>>
{
fn destroy(
collection: &Self::Id,
@@ -160,7 +160,7 @@ impl<T: Config<I>, I: 'static> Destroy<CheckOrigin<T::RuntimeOrigin, WithWitness
Err(origin) => Some(ensure_signed(origin)?),
};
<Pallet<T, I>>::do_destroy_collection(collection.clone(), witness, maybe_check_owner)
<Pezpallet<T, I>>::do_destroy_collection(collection.clone(), witness, maybe_check_owner)
.map(|_witness| ())
}
}
@@ -38,11 +38,11 @@ use pezsp_runtime::DispatchError;
pub struct Item<PalletInstance>(PhantomData<PalletInstance>);
impl<T: Config<I>, I: 'static> AssetDefinition for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> AssetDefinition for Item<Pezpallet<T, I>> {
type Id = (T::CollectionId, T::ItemId);
}
impl<T: Config<I>, I: 'static> Inspect<Owner<T::AccountId>> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Inspect<Owner<T::AccountId>> for Item<Pezpallet<T, I>> {
fn inspect(
(collection, item): &Self::Id,
_ownership: Owner<T::AccountId>,
@@ -53,7 +53,7 @@ impl<T: Config<I>, I: 'static> Inspect<Owner<T::AccountId>> for Item<Pallet<T, I
}
}
impl<T: Config<I>, I: 'static> Inspect<Bytes> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Inspect<Bytes> for Item<Pezpallet<T, I>> {
fn inspect((collection, item): &Self::Id, _bytes: Bytes) -> Result<Vec<u8>, DispatchError> {
ItemMetadataOf::<T, I>::get(collection, item)
.map(|m| m.data.into())
@@ -61,7 +61,7 @@ impl<T: Config<I>, I: 'static> Inspect<Bytes> for Item<Pallet<T, I>> {
}
}
impl<'a, T: Config<I>, I: 'static> Inspect<Bytes<Attribute<'a>>> for Item<Pallet<T, I>> {
impl<'a, T: Config<I>, I: 'static> Inspect<Bytes<Attribute<'a>>> for Item<Pezpallet<T, I>> {
fn inspect(
(collection, item): &Self::Id,
strategy: Bytes<Attribute>,
@@ -76,7 +76,7 @@ impl<'a, T: Config<I>, I: 'static> Inspect<Bytes<Attribute<'a>>> for Item<Pallet
}
}
impl<T: Config<I>, I: 'static> Inspect<CanUpdate<Owner<T::AccountId>>> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Inspect<CanUpdate<Owner<T::AccountId>>> for Item<Pezpallet<T, I>> {
fn inspect(
(collection, item): &Self::Id,
_can_update: CanUpdate<Owner<T::AccountId>>,
@@ -88,21 +88,21 @@ impl<T: Config<I>, I: 'static> Inspect<CanUpdate<Owner<T::AccountId>>> for Item<
}
}
impl<T: Config<I>, I: 'static> Create<WithItemConfig<T, I>> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Create<WithItemConfig<T, I>> for Item<Pezpallet<T, I>> {
fn create(
strategy: WithItemConfig<T, I>,
) -> Result<(T::CollectionId, T::ItemId), DispatchError> {
let WithConfig { config: ConfigValue::<_>(owner), extra: id_assignment } = strategy;
let (collection, item) = id_assignment.params;
<Pallet<T, I>>::do_mint(collection.clone(), item, owner, |_| Ok(()))?;
<Pezpallet<T, I>>::do_mint(collection.clone(), item, owner, |_| Ok(()))?;
Ok((collection, item))
}
}
impl<T: Config<I>, I: 'static> Create<CheckOrigin<T::RuntimeOrigin, WithItemConfig<T, I>>>
for Item<Pallet<T, I>>
for Item<Pezpallet<T, I>>
{
fn create(
strategy: CheckOrigin<T::RuntimeOrigin, WithItemConfig<T, I>>,
@@ -115,7 +115,7 @@ impl<T: Config<I>, I: 'static> Create<CheckOrigin<T::RuntimeOrigin, WithItemConf
let signer = ensure_signed(origin)?;
<Pallet<T, I>>::do_mint(collection.clone(), item, owner, |collection_details| {
<Pezpallet<T, I>>::do_mint(collection.clone(), item, owner, |collection_details| {
ensure!(collection_details.issuer == signer, Error::<T, I>::NoPermission);
Ok(())
})?;
@@ -124,18 +124,18 @@ impl<T: Config<I>, I: 'static> Create<CheckOrigin<T::RuntimeOrigin, WithItemConf
}
}
impl<T: Config<I>, I: 'static> Update<Owner<T::AccountId>> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Update<Owner<T::AccountId>> for Item<Pezpallet<T, I>> {
fn update(
(collection, item): &Self::Id,
_strategy: Owner<T::AccountId>,
dest: &T::AccountId,
) -> DispatchResult {
<Pallet<T, I>>::do_transfer(collection.clone(), *item, dest.clone(), |_, _| Ok(()))
<Pezpallet<T, I>>::do_transfer(collection.clone(), *item, dest.clone(), |_, _| Ok(()))
}
}
impl<T: Config<I>, I: 'static> Update<CheckOrigin<T::RuntimeOrigin, Owner<T::AccountId>>>
for Item<Pallet<T, I>>
for Item<Pezpallet<T, I>>
{
fn update(
(collection, item): &Self::Id,
@@ -146,7 +146,7 @@ impl<T: Config<I>, I: 'static> Update<CheckOrigin<T::RuntimeOrigin, Owner<T::Acc
let signer = ensure_signed(origin)?;
<Pallet<T, I>>::do_transfer(
<Pezpallet<T, I>>::do_transfer(
collection.clone(),
*item,
dest.clone(),
@@ -161,7 +161,7 @@ impl<T: Config<I>, I: 'static> Update<CheckOrigin<T::RuntimeOrigin, Owner<T::Acc
}
}
impl<T: Config<I>, I: 'static> Update<ChangeOwnerFrom<T::AccountId>> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Update<ChangeOwnerFrom<T::AccountId>> for Item<Pezpallet<T, I>> {
fn update(
(collection, item): &Self::Id,
strategy: ChangeOwnerFrom<T::AccountId>,
@@ -169,20 +169,20 @@ impl<T: Config<I>, I: 'static> Update<ChangeOwnerFrom<T::AccountId>> for Item<Pa
) -> DispatchResult {
let CheckState(from, ..) = strategy;
<Pallet<T, I>>::do_transfer(collection.clone(), *item, dest.clone(), |_, details| {
<Pezpallet<T, I>>::do_transfer(collection.clone(), *item, dest.clone(), |_, details| {
ensure!(details.owner == from, Error::<T, I>::WrongOwner);
Ok(())
})
}
}
impl<T: Config<I>, I: 'static> Stash<NoParams> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Stash<NoParams> for Item<Pezpallet<T, I>> {
fn stash((collection, item): &Self::Id, _strategy: NoParams) -> DispatchResult {
<Pallet<T, I>>::do_burn(collection.clone(), *item, |_, _| Ok(()))
<Pezpallet<T, I>>::do_burn(collection.clone(), *item, |_, _| Ok(()))
}
}
impl<T: Config<I>, I: 'static> Stash<CheckOrigin<T::RuntimeOrigin>> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Stash<CheckOrigin<T::RuntimeOrigin>> for Item<Pezpallet<T, I>> {
fn stash(
(collection, item): &Self::Id,
strategy: CheckOrigin<T::RuntimeOrigin>,
@@ -191,7 +191,7 @@ impl<T: Config<I>, I: 'static> Stash<CheckOrigin<T::RuntimeOrigin>> for Item<Pal
let signer = ensure_signed(origin)?;
<Pallet<T, I>>::do_burn(collection.clone(), *item, |collection_details, details| {
<Pezpallet<T, I>>::do_burn(collection.clone(), *item, |collection_details, details| {
let is_permitted = collection_details.admin == signer || details.owner == signer;
ensure!(is_permitted, Error::<T, I>::NoPermission);
Ok(())
@@ -199,11 +199,11 @@ impl<T: Config<I>, I: 'static> Stash<CheckOrigin<T::RuntimeOrigin>> for Item<Pal
}
}
impl<T: Config<I>, I: 'static> Stash<IfOwnedBy<T::AccountId>> for Item<Pallet<T, I>> {
impl<T: Config<I>, I: 'static> Stash<IfOwnedBy<T::AccountId>> for Item<Pezpallet<T, I>> {
fn stash((collection, item): &Self::Id, strategy: IfOwnedBy<T::AccountId>) -> DispatchResult {
let CheckState(who, ..) = strategy;
<Pallet<T, I>>::do_burn(collection.clone(), *item, |_, d| {
<Pezpallet<T, I>>::do_burn(collection.clone(), *item, |_, d| {
ensure!(d.owner == who, Error::<T, I>::NoPermission);
Ok(())
})
@@ -216,7 +216,7 @@ impl<T: Config<I>, I: 'static> Stash<IfOwnedBy<T::AccountId>> for Item<Pallet<T,
// If an NFT is minted for the first time, it can be regarded as "restored" with an empty data
// because it is indistinguishable from a burned empty NFT from the chain's perspective.
impl<T: Config<I>, I: 'static> Restore<WithConfig<ConfigValue<Owner<T::AccountId>>>>
for Item<Pallet<T, I>>
for Item<Pezpallet<T, I>>
{
fn restore(
(collection, item): &Self::Id,
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Uniques pallet benchmarking.
//! Uniques pezpallet benchmarking.
#![cfg(feature = "runtime-benchmarks")]
@@ -31,7 +31,7 @@ use pezframe_support::{
use pezframe_system::RawOrigin as SystemOrigin;
use pezsp_runtime::traits::Bounded;
use crate::Pallet as Uniques;
use crate::Pezpallet as Uniques;
const SEED: u32 = 0;
@@ -126,7 +126,7 @@ fn add_item_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];
+1 -1
View File
@@ -24,7 +24,7 @@ use pezframe_support::{
};
use pezsp_runtime::{DispatchError, DispatchResult};
impl<T: Config<I>, I: 'static> Pallet<T, I> {
impl<T: Config<I>, I: 'static> Pezpallet<T, I> {
/// Perform a transfer of an item from one account to another within a collection.
///
/// # Errors
@@ -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;
@@ -86,7 +86,7 @@ impl<T: Config<I>, I: 'static> Inspect<<T as SystemConfig>::AccountId> for Palle
}
}
impl<T: Config<I>, I: 'static> Create<<T as SystemConfig>::AccountId> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> Create<<T as SystemConfig>::AccountId> for Pezpallet<T, I> {
/// Create a `collection` of nonfungible items to be owned by `who` and managed by `admin`.
fn create_collection(
collection: &Self::CollectionId,
@@ -108,7 +108,7 @@ impl<T: Config<I>, I: 'static> Create<<T as SystemConfig>::AccountId> for Pallet
}
}
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> {
@@ -124,7 +124,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> for Pallet<T, I> {
impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId> for Pezpallet<T, I> {
fn mint_into(
collection: &Self::CollectionId,
item: &Self::ItemId,
@@ -149,7 +149,7 @@ impl<T: Config<I>, I: 'static> Mutate<<T as SystemConfig>::AccountId> for Pallet
}
}
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,
@@ -159,7 +159,7 @@ impl<T: Config<I>, I: 'static> Transfer<T::AccountId> for Pallet<T, I> {
}
}
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 =
+94 -94
View File
@@ -56,27 +56,27 @@ use pezsp_runtime::{
ArithmeticError, RuntimeDebug,
};
pub use pallet::*;
pub use pezpallet::*;
pub use types::*;
pub use weights::WeightInfo;
/// The log target for this pallet.
/// The log target for this pezpallet.
const LOG_TARGET: &str = "runtime::uniques";
/// 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 pezframe_system::Config>::Lookup as StaticLookup>::Source;
#[pezframe_support::pallet]
pub mod pallet {
#[pezframe_support::pezpallet]
pub mod pezpallet {
use super::*;
use pezframe_support::pezpallet_prelude::*;
use pezframe_system::pezpallet_prelude::*;
const STORAGE_VERSION: StorageVersion = StorageVersion::new(1);
#[pallet::pallet]
#[pallet::storage_version(STORAGE_VERSION)]
pub struct Pallet<T, I = ()>(_);
#[pezpallet::pezpallet]
#[pezpallet::storage_version(STORAGE_VERSION)]
pub struct Pezpallet<T, I = ()>(_);
#[cfg(feature = "runtime-benchmarks")]
pub trait BenchmarkHelper<CollectionId, ItemId> {
@@ -93,7 +93,7 @@ pub mod pallet {
}
}
#[pallet::config]
#[pezpallet::config]
/// The module configuration trait.
pub trait Config<I: 'static = ()>: pezframe_system::Config {
/// The overarching event type.
@@ -126,48 +126,48 @@ 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>;
#[cfg(feature = "runtime-benchmarks")]
/// A set of helper functions for benchmarking.
type Helper: BenchmarkHelper<Self::CollectionId, Self::ItemId>;
/// Weight information for extrinsics in this pallet.
/// Weight information for extrinsics in this pezpallet.
type WeightInfo: WeightInfo;
}
#[pallet::storage]
#[pallet::storage_prefix = "Class"]
#[pezpallet::storage]
#[pezpallet::storage_prefix = "Class"]
/// Details of a collection.
pub type Collection<T: Config<I>, I: 'static = ()> = StorageMap<
_,
@@ -176,12 +176,12 @@ pub mod pallet {
CollectionDetails<T::AccountId, DepositBalanceOf<T, I>>,
>;
#[pallet::storage]
#[pezpallet::storage]
/// The collection, if any, of which an account is willing to take ownership.
pub type OwnershipAcceptance<T: Config<I>, I: 'static = ()> =
StorageMap<_, Blake2_128Concat, T::AccountId, T::CollectionId>;
#[pallet::storage]
#[pezpallet::storage]
/// The items held by any given account; set out this way so that items owned by a single
/// account can be enumerated.
pub type Account<T: Config<I>, I: 'static = ()> = StorageNMap<
@@ -195,8 +195,8 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::storage]
#[pallet::storage_prefix = "ClassAccount"]
#[pezpallet::storage]
#[pezpallet::storage_prefix = "ClassAccount"]
/// The collections owned by any given account; set out this way so that collections owned by
/// a single account can be enumerated.
pub type CollectionAccount<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
@@ -209,8 +209,8 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::storage]
#[pallet::storage_prefix = "Asset"]
#[pezpallet::storage]
#[pezpallet::storage_prefix = "Asset"]
/// The items in existence and their ownership details.
pub type Item<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
@@ -222,8 +222,8 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::storage]
#[pallet::storage_prefix = "ClassMetadataOf"]
#[pezpallet::storage]
#[pezpallet::storage_prefix = "ClassMetadataOf"]
/// Metadata of a collection.
pub type CollectionMetadataOf<T: Config<I>, I: 'static = ()> = StorageMap<
_,
@@ -233,8 +233,8 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::storage]
#[pallet::storage_prefix = "InstanceMetadataOf"]
#[pezpallet::storage]
#[pezpallet::storage_prefix = "InstanceMetadataOf"]
/// Metadata of an item.
pub type ItemMetadataOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
@@ -246,7 +246,7 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::storage]
#[pezpallet::storage]
/// Attributes of a collection.
pub type Attribute<T: Config<I>, I: 'static = ()> = StorageNMap<
_,
@@ -259,7 +259,7 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::storage]
#[pezpallet::storage]
/// Price of an asset instance.
pub type ItemPriceOf<T: Config<I>, I: 'static = ()> = StorageDoubleMap<
_,
@@ -271,13 +271,13 @@ pub mod pallet {
OptionQuery,
>;
#[pallet::storage]
#[pezpallet::storage]
/// Keeps track of the number of items a collection might have.
pub type CollectionMaxSupply<T: Config<I>, I: 'static = ()> =
StorageMap<_, Blake2_128Concat, T::CollectionId, u32, 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 },
@@ -386,7 +386,7 @@ pub mod pallet {
},
}
#[pallet::error]
#[pezpallet::error]
pub enum Error<T, I = ()> {
/// The signing account has no permission to do the operation.
NoPermission,
@@ -434,7 +434,7 @@ pub mod pallet {
WrongAttribute,
}
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)
@@ -446,8 +446,8 @@ pub mod pallet {
}
}
#[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.
@@ -464,8 +464,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>,
collection: T::CollectionId,
@@ -501,8 +501,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>,
collection: T::CollectionId,
@@ -537,8 +537,8 @@ pub mod pallet {
/// - `n = witness.items`
/// - `m = witness.item_metadatas`
/// - `a = witness.attributes`
#[pallet::call_index(2)]
#[pallet::weight(T::WeightInfo::destroy(
#[pezpallet::call_index(2)]
#[pezpallet::weight(T::WeightInfo::destroy(
witness.items,
witness.item_metadatas,
witness.attributes,
@@ -573,8 +573,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,
@@ -605,8 +605,8 @@ pub mod pallet {
///
/// Weight: `O(1)`
/// Modes: `check_owner.is_some()`.
#[pallet::call_index(4)]
#[pallet::weight(T::WeightInfo::burn())]
#[pezpallet::call_index(4)]
#[pezpallet::weight(T::WeightInfo::burn())]
pub fn burn(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -644,8 +644,8 @@ pub mod pallet {
/// Emits `Transferred`.
///
/// Weight: `O(1)`
#[pallet::call_index(5)]
#[pallet::weight(T::WeightInfo::transfer())]
#[pezpallet::call_index(5)]
#[pezpallet::weight(T::WeightInfo::transfer())]
pub fn transfer(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -681,8 +681,8 @@ pub mod pallet {
/// is not permitted to call it.
///
/// Weight: `O(items.len())`
#[pallet::call_index(6)]
#[pallet::weight(T::WeightInfo::redeposit(items.len() as u32))]
#[pezpallet::call_index(6)]
#[pezpallet::weight(T::WeightInfo::redeposit(items.len() as u32))]
pub fn redeposit(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -742,8 +742,8 @@ pub mod pallet {
/// Emits `Frozen`.
///
/// Weight: `O(1)`
#[pallet::call_index(7)]
#[pallet::weight(T::WeightInfo::freeze())]
#[pezpallet::call_index(7)]
#[pezpallet::weight(T::WeightInfo::freeze())]
pub fn freeze(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -774,8 +774,8 @@ pub mod pallet {
/// Emits `Thawed`.
///
/// Weight: `O(1)`
#[pallet::call_index(8)]
#[pallet::weight(T::WeightInfo::thaw())]
#[pezpallet::call_index(8)]
#[pezpallet::weight(T::WeightInfo::thaw())]
pub fn thaw(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -805,8 +805,8 @@ pub mod pallet {
/// Emits `CollectionFrozen`.
///
/// Weight: `O(1)`
#[pallet::call_index(9)]
#[pallet::weight(T::WeightInfo::freeze_collection())]
#[pezpallet::call_index(9)]
#[pezpallet::weight(T::WeightInfo::freeze_collection())]
pub fn freeze_collection(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -833,8 +833,8 @@ pub mod pallet {
/// Emits `CollectionThawed`.
///
/// Weight: `O(1)`
#[pallet::call_index(10)]
#[pallet::weight(T::WeightInfo::thaw_collection())]
#[pezpallet::call_index(10)]
#[pezpallet::weight(T::WeightInfo::thaw_collection())]
pub fn thaw_collection(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -863,8 +863,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,
@@ -896,7 +896,7 @@ pub mod pallet {
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);
Self::deposit_event(Event::OwnerChanged { collection, new_owner });
Ok(())
@@ -915,8 +915,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,
@@ -956,8 +956,8 @@ pub mod pallet {
/// Emits `ApprovedTransfer` on success.
///
/// Weight: `O(1)`
#[pallet::call_index(13)]
#[pallet::weight(T::WeightInfo::approve_transfer())]
#[pezpallet::call_index(13)]
#[pezpallet::weight(T::WeightInfo::approve_transfer())]
pub fn approve_transfer(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1010,8 +1010,8 @@ pub mod pallet {
/// Emits `ApprovalCancelled` on success.
///
/// Weight: `O(1)`
#[pallet::call_index(14)]
#[pallet::weight(T::WeightInfo::cancel_approval())]
#[pezpallet::call_index(14)]
#[pezpallet::weight(T::WeightInfo::cancel_approval())]
pub fn cancel_approval(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1063,8 +1063,8 @@ pub mod pallet {
/// Emits `ItemStatusChanged` with the identity of the item.
///
/// Weight: `O(1)`
#[pallet::call_index(15)]
#[pallet::weight(T::WeightInfo::force_item_status())]
#[pezpallet::call_index(15)]
#[pezpallet::weight(T::WeightInfo::force_item_status())]
pub fn force_item_status(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1113,8 +1113,8 @@ pub mod pallet {
/// Emits `AttributeSet`.
///
/// Weight: `O(1)`
#[pallet::call_index(16)]
#[pallet::weight(T::WeightInfo::set_attribute())]
#[pezpallet::call_index(16)]
#[pezpallet::weight(T::WeightInfo::set_attribute())]
pub fn set_attribute(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1177,8 +1177,8 @@ pub mod pallet {
/// Emits `AttributeCleared`.
///
/// Weight: `O(1)`
#[pallet::call_index(17)]
#[pallet::weight(T::WeightInfo::clear_attribute())]
#[pezpallet::call_index(17)]
#[pezpallet::weight(T::WeightInfo::clear_attribute())]
pub fn clear_attribute(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1230,8 +1230,8 @@ pub mod pallet {
/// Emits `MetadataSet`.
///
/// Weight: `O(1)`
#[pallet::call_index(18)]
#[pallet::weight(T::WeightInfo::set_metadata())]
#[pezpallet::call_index(18)]
#[pezpallet::weight(T::WeightInfo::set_metadata())]
pub fn set_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1293,8 +1293,8 @@ pub mod pallet {
/// Emits `MetadataCleared`.
///
/// Weight: `O(1)`
#[pallet::call_index(19)]
#[pallet::weight(T::WeightInfo::clear_metadata())]
#[pezpallet::call_index(19)]
#[pezpallet::weight(T::WeightInfo::clear_metadata())]
pub fn clear_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1343,8 +1343,8 @@ pub mod pallet {
/// Emits `CollectionMetadataSet`.
///
/// Weight: `O(1)`
#[pallet::call_index(20)]
#[pallet::weight(T::WeightInfo::set_collection_metadata())]
#[pezpallet::call_index(20)]
#[pezpallet::weight(T::WeightInfo::set_collection_metadata())]
pub fn set_collection_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1401,8 +1401,8 @@ pub mod pallet {
/// Emits `CollectionMetadataCleared`.
///
/// Weight: `O(1)`
#[pallet::call_index(21)]
#[pallet::weight(T::WeightInfo::clear_collection_metadata())]
#[pezpallet::call_index(21)]
#[pezpallet::weight(T::WeightInfo::clear_collection_metadata())]
pub fn clear_collection_metadata(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1440,8 +1440,8 @@ pub mod pallet {
/// ownership transferal.
///
/// Emits `OwnershipAcceptanceChanged`.
#[pallet::call_index(22)]
#[pallet::weight(T::WeightInfo::set_accept_ownership())]
#[pezpallet::call_index(22)]
#[pezpallet::weight(T::WeightInfo::set_accept_ownership())]
pub fn set_accept_ownership(
origin: OriginFor<T>,
maybe_collection: Option<T::CollectionId>,
@@ -1450,10 +1450,10 @@ pub mod pallet {
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);
},
_ => {},
}
@@ -1477,8 +1477,8 @@ pub mod pallet {
/// - `max_supply`: The maximum amount of items a collection could have.
///
/// Emits `CollectionMaxSupplySet` event when successful.
#[pallet::call_index(23)]
#[pallet::weight(T::WeightInfo::set_collection_max_supply())]
#[pezpallet::call_index(23)]
#[pezpallet::weight(T::WeightInfo::set_collection_max_supply())]
pub fn set_collection_max_supply(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1517,8 +1517,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(24)]
#[pallet::weight(T::WeightInfo::set_price())]
#[pezpallet::call_index(24)]
#[pezpallet::weight(T::WeightInfo::set_price())]
pub fn set_price(
origin: OriginFor<T>,
collection: T::CollectionId,
@@ -1540,8 +1540,8 @@ pub mod pallet {
/// - `bid_price`: The price the sender is willing to pay.
///
/// Emits `ItemBought` on success.
#[pallet::call_index(25)]
#[pallet::weight(T::WeightInfo::buy_item())]
#[pezpallet::call_index(25)]
#[pezpallet::weight(T::WeightInfo::buy_item())]
pub fn buy_item(
origin: OriginFor<T>,
collection: T::CollectionId,
+2 -2
View File
@@ -45,11 +45,11 @@ mod v1 {
}
}
/// Migrate the pallet storage from `0` to `1`.
/// Migrate the pezpallet storage from `0` to `1`.
pub type MigrateV0ToV1<T, I> = pezframe_support::migrations::VersionedMigration<
0,
1,
v1::UncheckedMigrateToV1Impl<T, I>,
Pallet<T, I>,
Pezpallet<T, I>,
<T as pezframe_system::Config>::DbWeight,
>;
+1 -1
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Test environment for Uniques pallet.
//! Test environment for Uniques pezpallet.
use super::*;
use crate as pezpallet_uniques;
+1 -1
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Tests for Uniques pallet.
//! Tests for Uniques pezpallet.
use crate::{mock::*, Event, *};
use pezframe_support::{assert_noop, assert_ok, traits::Currency};
+2 -2
View File
@@ -15,7 +15,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//! Various basic types for use in the Uniques pallet.
//! Various basic types for use in the Uniques pezpallet.
use super::*;
use pezframe_support::{
@@ -105,7 +105,7 @@ pub struct ItemDetails<AccountId, DepositBalance> {
pub approved: Option<AccountId>,
/// Whether the item can be transferred or not.
pub is_frozen: bool,
/// 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: DepositBalance,
}
+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_uniques
// --pezpallet=pezpallet_uniques
// --header=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/HEADER-APACHE2
// --output=/__w/pezkuwi-sdk/pezkuwi-sdk/bizinikiwi/pezframe/uniques/src/weights.rs
// --wasm-execution=compiled