Minor Uniques pallet improvements and XCM v3 preparations (#10896)

* Introduce Helper to Uniques for benchmark stuff

* Fixes

* Formatting

* Featuregate the Helper, include ContainsPair

* Introduce & use EnsureOriginWithArg

* Benchmarking

* Docs

* More ContainsBoth helpers

* Formatting

* Formatting

* Fixes

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Gavin Wood
2022-03-07 09:12:03 +01:00
committed by GitHub
parent 6f59a8b183
commit 2c373c1e16
12 changed files with 422 additions and 118 deletions
@@ -85,7 +85,10 @@ pub trait Mutate<AccountId>: Inspect<AccountId> {
/// Burn some asset `instance`.
///
/// By default, this is not a supported operation.
fn burn_from(_instance: &Self::InstanceId) -> DispatchResult {
fn burn(
_instance: &Self::InstanceId,
_maybe_check_owner: Option<&AccountId>,
) -> DispatchResult {
Err(TokenError::Unsupported.into())
}
@@ -166,8 +169,8 @@ impl<
fn mint_into(instance: &Self::InstanceId, who: &AccountId) -> DispatchResult {
<F as nonfungibles::Mutate<AccountId>>::mint_into(&A::get(), instance, who)
}
fn burn_from(instance: &Self::InstanceId) -> DispatchResult {
<F as nonfungibles::Mutate<AccountId>>::burn_from(&A::get(), instance)
fn burn(instance: &Self::InstanceId, maybe_check_owner: Option<&AccountId>) -> DispatchResult {
<F as nonfungibles::Mutate<AccountId>>::burn(&A::get(), instance, maybe_check_owner)
}
fn set_attribute(instance: &Self::InstanceId, key: &[u8], value: &[u8]) -> DispatchResult {
<F as nonfungibles::Mutate<AccountId>>::set_attribute(&A::get(), instance, key, value)
@@ -165,7 +165,11 @@ pub trait Mutate<AccountId>: Inspect<AccountId> {
/// Burn some asset `instance` of `class`.
///
/// By default, this is not a supported operation.
fn burn_from(_class: &Self::ClassId, _instance: &Self::InstanceId) -> DispatchResult {
fn burn(
_class: &Self::ClassId,
_instance: &Self::InstanceId,
_maybe_check_owner: Option<&AccountId>,
) -> DispatchResult {
Err(TokenError::Unsupported.into())
}