Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 33eee69

Browse files
authored
Add amalgamation traits for NFT CollectionId and ItemId (#13514)
* Add amalgamation traits for NFT CollectionId, ItemId, and DestroyWitness * Apply @bkchr suggests * ".git/.scripts/commands/fmt/fmt.sh" --------- Co-authored-by: command-bot <>
1 parent 48c8875 commit 33eee69

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

frame/support/src/traits/tokens/nonfungible_v2.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,18 @@
2525
//! use.
2626
2727
use super::nonfungibles_v2 as nonfungibles;
28-
use crate::{dispatch::DispatchResult, traits::Get};
28+
use crate::{
29+
dispatch::{DispatchResult, Parameter},
30+
traits::Get,
31+
};
2932
use codec::{Decode, Encode};
3033
use sp_runtime::TokenError;
3134
use sp_std::prelude::*;
3235

3336
/// Trait for providing an interface to a read-only NFT-like item.
3437
pub trait Inspect<AccountId> {
3538
/// Type for identifying an item.
36-
type ItemId;
39+
type ItemId: Parameter;
3740

3841
/// Returns the owner of `item`, or `None` if the item doesn't exist or has no
3942
/// owner.

frame/support/src/traits/tokens/nonfungibles_v2.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,19 @@
2727
//! Implementations of these traits may be converted to implementations of corresponding
2828
//! `nonfungible` traits by using the `nonfungible::ItemOf` type adapter.
2929
30-
use crate::dispatch::{DispatchError, DispatchResult};
30+
use crate::dispatch::{DispatchError, DispatchResult, Parameter};
3131
use codec::{Decode, Encode};
3232
use sp_runtime::TokenError;
3333
use sp_std::prelude::*;
3434

3535
/// Trait for providing an interface to many read-only NFT-like sets of items.
3636
pub trait Inspect<AccountId> {
3737
/// Type for identifying an item.
38-
type ItemId;
38+
type ItemId: Parameter;
3939

4040
/// Type for identifying a collection (an identifier for an independent collection of
4141
/// items).
42-
type CollectionId;
42+
type CollectionId: Parameter;
4343

4444
/// Returns the owner of `item` of `collection`, or `None` if the item doesn't exist
4545
/// (or somehow has no owner).
@@ -193,7 +193,7 @@ pub trait Create<AccountId, CollectionConfig>: Inspect<AccountId> {
193193
/// Trait for providing the ability to destroy collections of nonfungible items.
194194
pub trait Destroy<AccountId>: Inspect<AccountId> {
195195
/// The witness data needed to destroy an item.
196-
type DestroyWitness;
196+
type DestroyWitness: Parameter;
197197

198198
/// Provide the appropriate witness data needed to destroy an item.
199199
fn get_destroy_witness(collection: &Self::CollectionId) -> Option<Self::DestroyWitness>;

0 commit comments

Comments
 (0)