Add nonfungibles::Create Trait & Implement for Uniques (#9438)

* Add nonfungibles::Create Trait & Implement for Uniques

Closes #9419

* Formatting

* Remove default implementation (`TokenError::Unsupported`) from `Create` trait

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>

* Formatting

* Do not wrap parameters in Options

* Formatting

Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
Dan Forbes
2021-07-28 06:39:04 -07:00
committed by GitHub
parent 52aa9c2ef7
commit 76611ba6a3
4 changed files with 74 additions and 40 deletions
@@ -117,6 +117,12 @@ pub trait InspectEnumerable<AccountId>: Inspect<AccountId> {
) -> Box<dyn Iterator<Item = Self::InstanceId>>;
}
/// Trait for providing the ability to create classes of nonfungible assets.
pub trait Create<AccountId>: Inspect<AccountId> {
/// Create a `class` of nonfungible assets to be owned by `who` and managed by `admin`.
fn create_class(class: &Self::ClassId, who: &AccountId, admin: &AccountId) -> DispatchResult;
}
/// Trait for providing an interface for multiple classes of NFT-like assets which may be minted,
/// burned and/or have attributes set on them.
pub trait Mutate<AccountId>: Inspect<AccountId> {