Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Change "asset collection" to "collection"
  • Loading branch information
Jegor Sidorenko committed May 10, 2022
commit cd89fa642c74050d3079827cbc79bdfd09a99f0b
14 changes: 7 additions & 7 deletions frame/support/src/traits/tokens/nonfungible.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ pub trait Inspect<AccountId> {
/// Type for identifying an asset.
type AssetId;

/// Returns the owner of asset `asset`, or `None` if the asset doesn't exist or has no
/// Returns the owner of `asset`, or `None` if the asset doesn't exist or has no
/// owner.
fn owner(asset: &Self::AssetId) -> Option<AccountId>;

Expand All @@ -54,7 +54,7 @@ pub trait Inspect<AccountId> {
.and_then(|v| V::decode(&mut &v[..]).ok())
}

/// Returns `true` if the asset `asset` may be transferred.
/// Returns `true` if the `asset` may be transferred.
///
/// Default implementation is that all assets are transferable.
fn can_transfer(_asset: &Self::AssetId) -> bool {
Expand All @@ -65,7 +65,7 @@ pub trait Inspect<AccountId> {
/// Interface for enumerating assets in existence or owned by a given account over a collection
/// of NFTs.
pub trait InspectEnumerable<AccountId>: Inspect<AccountId> {
/// Returns an iterator of the assets of an asset `collection` in existence.
/// Returns an iterator of the assets within a `collection` in existence.
fn assets() -> Box<dyn Iterator<Item = Self::AssetId>>;

/// Returns an iterator of the assets of all collections owned by `who`.
Expand All @@ -75,21 +75,21 @@ pub trait InspectEnumerable<AccountId>: Inspect<AccountId> {
/// Trait for providing an interface for NFT-like assets which may be minted, burned and/or have
/// attributes set on them.
pub trait Mutate<AccountId>: Inspect<AccountId> {
/// Mint some asset `asset` to be owned by `who`.
/// Mint some `asset` to be owned by `who`.
///
/// By default, this is not a supported operation.
fn mint_into(_asset: &Self::AssetId, _who: &AccountId) -> DispatchResult {
Err(TokenError::Unsupported.into())
}

/// Burn some asset `asset`.
/// Burn some `asset`.
///
/// By default, this is not a supported operation.
fn burn(_asset: &Self::AssetId, _maybe_check_owner: Option<&AccountId>) -> DispatchResult {
Err(TokenError::Unsupported.into())
}

/// Set attribute `value` of asset `asset`'s `key`.
/// Set attribute `value` of `asset`'s `key`.
///
/// By default, this is not a supported operation.
fn set_attribute(_asset: &Self::AssetId, _key: &[u8], _value: &[u8]) -> DispatchResult {
Expand All @@ -110,7 +110,7 @@ pub trait Mutate<AccountId>: Inspect<AccountId> {

/// Trait for providing a non-fungible set of assets which can only be transferred.
pub trait Transfer<AccountId>: Inspect<AccountId> {
/// Transfer asset `asset` into `destination` account.
/// Transfer `asset` into `destination` account.
fn transfer(asset: &Self::AssetId, destination: &AccountId) -> DispatchResult;
}

Expand Down
18 changes: 9 additions & 9 deletions frame/support/src/traits/tokens/nonfungibles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ pub trait Inspect<AccountId> {
/// assets).
type CollectionId;

/// Returns the owner of asset `asset` of `collection`, or `None` if the asset doesn't exist
/// Returns the owner of `asset` of `collection`, or `None` if the asset doesn't exist
/// (or somehow has no owner).
fn owner(collection: &Self::CollectionId, asset: &Self::AssetId) -> Option<AccountId>;

/// Returns the owner of the asset `collection`, if there is one. For many NFTs this may not
/// Returns the owner of the `collection`, if there is one. For many NFTs this may not
/// make any sense, so users of this API should not be surprised to find an assets collection
/// results in `None` here.
fn collection_owner(_collection: &Self::CollectionId) -> Option<AccountId> {
Expand Down Expand Up @@ -94,7 +94,7 @@ pub trait Inspect<AccountId> {
.and_then(|v| V::decode(&mut &v[..]).ok())
}

/// Returns `true` if the asset `asset` of `collection` may be transferred.
/// Returns `true` if the `asset` of `collection` may be transferred.
///
/// Default implementation is that all assets are transferable.
fn can_transfer(_collection: &Self::CollectionId, _asset: &Self::AssetId) -> bool {
Expand All @@ -108,7 +108,7 @@ pub trait InspectEnumerable<AccountId>: Inspect<AccountId> {
/// Returns an iterator of the assets collections in existence.
fn collections() -> Box<dyn Iterator<Item = Self::CollectionId>>;

/// Returns an iterator of the assets of an asset `collection` in existence.
/// Returns an iterator of the assets of a `collection` in existence.
fn assets(collection: &Self::CollectionId) -> Box<dyn Iterator<Item = Self::AssetId>>;

/// Returns an iterator of the assets of all collections owned by `who`.
Expand Down Expand Up @@ -159,7 +159,7 @@ pub trait Destroy<AccountId>: Inspect<AccountId> {
/// Trait for providing an interface for multiple collections of NFT-like assets which may be
/// minted, burned and/or have attributes set on them.
pub trait Mutate<AccountId>: Inspect<AccountId> {
/// Mint some asset `asset` of `collection` to be owned by `who`.
/// Mint some `asset` of `collection` to be owned by `who`.
///
/// By default, this is not a supported operation.
fn mint_into(
Expand All @@ -170,7 +170,7 @@ pub trait Mutate<AccountId>: Inspect<AccountId> {
Err(TokenError::Unsupported.into())
}

/// Burn some asset `asset` of `collection`.
/// Burn some `asset` of `collection`.
///
/// By default, this is not a supported operation.
fn burn(
Expand All @@ -181,7 +181,7 @@ pub trait Mutate<AccountId>: Inspect<AccountId> {
Err(TokenError::Unsupported.into())
}

/// Set attribute `value` of asset `asset` of `collection`'s `key`.
/// Set attribute `value` of `asset` of `collection`'s `key`.
///
/// By default, this is not a supported operation.
fn set_attribute(
Expand All @@ -205,7 +205,7 @@ pub trait Mutate<AccountId>: Inspect<AccountId> {
key.using_encoded(|k| value.using_encoded(|v| Self::set_attribute(collection, asset, k, v)))
}

/// Set attribute `value` of asset `collection`'s `key`.
/// Set attribute `value` of `collection`'s `key`.
///
/// By default, this is not a supported operation.
fn set_collection_attribute(
Expand All @@ -232,7 +232,7 @@ pub trait Mutate<AccountId>: Inspect<AccountId> {

/// Trait for providing a non-fungible sets of assets which can only be transferred.
pub trait Transfer<AccountId>: Inspect<AccountId> {
/// Transfer asset `asset` of `collection` into `destination` account.
/// Transfer `asset` of `collection` into `destination` account.
fn transfer(
collection: &Self::CollectionId,
asset: &Self::AssetId,
Expand Down
4 changes: 2 additions & 2 deletions frame/uniques/src/impl_nonfungibles.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl<T: Config<I>, I: 'static> Inspect<<T as SystemConfig>::AccountId> for Palle
}
}

/// Returns `true` if the asset `asset` of `collection` may be transferred.
/// Returns `true` if the `asset` of `collection` may be transferred.
///
/// Default implementation is that all assets are transferable.
fn can_transfer(collection: &Self::CollectionId, asset: &Self::AssetId) -> bool {
Expand Down Expand Up @@ -163,7 +163,7 @@ impl<T: Config<I>, I: 'static> InspectEnumerable<T::AccountId> for Pallet<T, I>
Box::new(CollectionMetadataOf::<T, I>::iter_keys())
}

/// Returns an iterator of the assets of an asset `collection` in existence.
/// Returns an iterator of the assets of a `collection` in existence.
///
/// NOTE: iterating this list invokes a storage read per item.
fn assets(collection: &Self::CollectionId) -> Box<dyn Iterator<Item = Self::AssetId>> {
Expand Down
66 changes: 33 additions & 33 deletions frame/uniques/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,28 +245,28 @@ pub mod pallet {
pub enum Event<T: Config<I>, I: 'static = ()> {
/// An assets collection was created.
Created { collection: T::CollectionId, creator: T::AccountId, owner: T::AccountId },
/// An assets collection was force-created.
/// A `collection` was force-created.
ForceCreated { collection: T::CollectionId, owner: T::AccountId },
/// An asset `collection` was destroyed.
/// A `collection` was destroyed.
Destroyed { collection: T::CollectionId },
/// An asset `asset` was issued.
/// An `asset` was issued.
Issued { collection: T::CollectionId, asset: T::AssetId, owner: T::AccountId },
/// An asset `asset` was transferred.
/// An `asset` was transferred.
Transferred {
collection: T::CollectionId,
asset: T::AssetId,
from: T::AccountId,
to: T::AccountId,
},
/// An asset `asset` was destroyed.
/// An `asset` was destroyed.
Burned { collection: T::CollectionId, asset: T::AssetId, owner: T::AccountId },
/// Some asset `asset` was frozen.
/// Some `asset` was frozen.
Frozen { collection: T::CollectionId, asset: T::AssetId },
/// Some asset `asset` was thawed.
/// Some `asset` was thawed.
Thawed { collection: T::CollectionId, asset: T::AssetId },
/// Some asset `collection` was frozen.
/// Some `collection` was frozen.
CollectionFrozen { collection: T::CollectionId },
/// Some asset `collection` was thawed.
/// Some `collection` was thawed.
CollectionThawed { collection: T::CollectionId },
/// The owner changed.
OwnerChanged { collection: T::CollectionId, new_owner: T::AccountId },
Expand All @@ -277,7 +277,7 @@ pub mod pallet {
admin: T::AccountId,
freezer: T::AccountId,
},
/// An `asset` of an asset `collection` has been approved by the `owner` for transfer by
/// An `asset` of a `collection` has been approved by the `owner` for transfer by
/// a `delegate`.
ApprovedTransfer {
collection: T::CollectionId,
Expand All @@ -293,7 +293,7 @@ pub mod pallet {
owner: T::AccountId,
delegate: T::AccountId,
},
/// An asset `collection` has had its attributes changed by the `Force` origin.
/// A `collection` has had its attributes changed by the `Force` origin.
AssetStatusChanged { collection: T::CollectionId },
/// New metadata has been set for an assets collection.
CollectionMetadataSet {
Expand Down Expand Up @@ -450,7 +450,7 @@ pub mod pallet {
/// Destroy a collection of fungible assets.
///
/// The origin must conform to `ForceOrigin` or must be `Signed` and the sender must be the
/// owner of the asset `collection`.
/// owner of the `collection`.
///
/// - `collection`: The identifier of the assets collection to be destroyed.
/// - `witness`: Information on the assets minted in the assets collection. This must be
Expand Down Expand Up @@ -488,7 +488,7 @@ pub mod pallet {

/// Mint an asset of a particular collection.
///
/// The origin must be Signed and the sender must be the Issuer of the asset `collection`.
/// The origin must be Signed and the sender must be the Issuer of the `collection`.
///
/// - `collection`: The collection of the asset to be minted.
/// - `asset`: The asset value of the asset to be minted.
Expand All @@ -515,7 +515,7 @@ pub mod pallet {

/// Destroy a single asset.
///
/// Origin must be Signed and the sender should be the Admin of the asset `collection`.
/// Origin must be Signed and the sender should be the Admin of the `collection`.
///
/// - `collection`: The collection of the asset to be burned.
/// - `asset`: The asset of the asset to be burned.
Expand Down Expand Up @@ -550,9 +550,9 @@ pub mod pallet {
/// Move an asset from the sender account to another.
///
/// Origin must be Signed and the signing account must be either:
/// - the Admin of the asset `collection`;
/// - the Owner of the asset `asset`;
/// - the approved delegate for the asset `asset` (in this case, the approval is reset).
/// - the Admin of the `collection`;
/// - the Owner of the `asset`;
/// - the approved delegate for the `asset` (in this case, the approval is reset).
///
/// Arguments:
/// - `collection`: The collection of the asset to be transferred.
Expand Down Expand Up @@ -583,7 +583,7 @@ pub mod pallet {

/// Reevaluate the deposits on some assets.
///
/// Origin must be Signed and the sender should be the Owner of the asset `collection`.
/// Origin must be Signed and the sender should be the Owner of the `collection`.
///
/// - `collection`: The collection of the asset to be frozen.
/// - `assets`: The assets of the assets collection whose deposits will be reevaluated.
Expand Down Expand Up @@ -650,7 +650,7 @@ pub mod pallet {

/// Disallow further unprivileged transfer of an asset.
///
/// Origin must be Signed and the sender should be the Freezer of the asset `collection`.
/// Origin must be Signed and the sender should be the Freezer of the `collection`.
///
/// - `collection`: The collection of the asset to be frozen.
/// - `asset`: The asset of the asset to be frozen.
Expand Down Expand Up @@ -681,7 +681,7 @@ pub mod pallet {

/// Re-allow unprivileged transfer of an asset.
///
/// Origin must be Signed and the sender should be the Freezer of the asset `collection`.
/// Origin must be Signed and the sender should be the Freezer of the `collection`.
///
/// - `collection`: The collection of the asset to be thawed.
/// - `asset`: The asset of the asset to be thawed.
Expand Down Expand Up @@ -712,7 +712,7 @@ pub mod pallet {

/// Disallow further unprivileged transfers for a whole assets collection.
///
/// Origin must be Signed and the sender should be the Freezer of the asset `collection`.
/// Origin must be Signed and the sender should be the Freezer of the `collection`.
///
/// - `collection`: The assets collection to be frozen.
///
Expand All @@ -739,7 +739,7 @@ pub mod pallet {

/// Re-allow unprivileged transfers for a whole assets collection.
///
/// Origin must be Signed and the sender should be the Admin of the asset `collection`.
/// Origin must be Signed and the sender should be the Admin of the `collection`.
///
/// - `collection`: The collection to be thawed.
///
Expand All @@ -766,7 +766,7 @@ pub mod pallet {

/// Change the Owner of an assets collection.
///
/// Origin must be Signed and the sender should be the Owner of the asset `collection`.
/// Origin must be Signed and the sender should be the Owner of the `collection`.
///
/// - `collection`: The assets collection whose owner should be changed.
/// - `owner`: The new Owner of this assets collection. They must have called
Expand Down Expand Up @@ -813,7 +813,7 @@ pub mod pallet {

/// Change the Issuer, Admin and Freezer of an assets collection.
///
/// Origin must be Signed and the sender should be the Owner of the asset `collection`.
/// Origin must be Signed and the sender should be the Owner of the `collection`.
///
/// - `collection`: The assets collection whose team should be changed.
/// - `issuer`: The new Issuer of this assets collection.
Expand Down Expand Up @@ -851,7 +851,7 @@ pub mod pallet {

/// Approve an asset to be transferred by a delegated third-party account.
///
/// Origin must be Signed and must be the owner of the asset `asset`.
/// Origin must be Signed and must be the owner of the `asset`.
///
/// - `collection`: The collection of the asset to be approved for delegated transfer.
/// - `asset`: The asset of the asset to be approved for delegated transfer.
Expand Down Expand Up @@ -901,8 +901,8 @@ pub mod pallet {
///
/// Origin must be either:
/// - the `Force` origin;
/// - `Signed` with the signer being the Admin of the asset `collection`;
/// - `Signed` with the signer being the Owner of the asset `asset`;
/// - `Signed` with the signer being the Admin of the `collection`;
/// - `Signed` with the signer being the Owner of the `asset`;
///
/// Arguments:
/// - `collection`: The collection of the asset of whose approval will be cancelled.
Expand Down Expand Up @@ -1001,7 +1001,7 @@ pub mod pallet {
/// Set an attribute for an assets collection or asset.
///
/// Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
/// asset `collection`.
/// `collection`.
///
/// If the origin is Signed, then funds of signer are reserved according to the formula:
/// `MetadataDepositBase + DepositPerByte * (key.len + value.len)` taking into
Expand Down Expand Up @@ -1066,7 +1066,7 @@ pub mod pallet {
/// Clear an attribute for an assets collection or asset.
///
/// Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
/// asset `collection`.
/// `collection`.
///
/// Any deposit is freed for the assets collection owner.
///
Expand Down Expand Up @@ -1112,7 +1112,7 @@ pub mod pallet {
/// Set the metadata for an asset.
///
/// Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
/// asset `collection`.
/// `collection`.
///
/// If the origin is Signed, then funds of signer are reserved according to the formula:
/// `MetadataDepositBase + DepositPerByte * data.len` taking into
Expand Down Expand Up @@ -1178,7 +1178,7 @@ pub mod pallet {
/// Clear the metadata for an asset.
///
/// Origin must be either `ForceOrigin` or Signed and the sender should be the Owner of the
/// asset `asset`.
/// `asset`.
///
/// Any deposit is freed for the assets collection owner.
///
Expand Down Expand Up @@ -1224,7 +1224,7 @@ pub mod pallet {
/// Set the metadata for an assets collection.
///
/// Origin must be either `ForceOrigin` or `Signed` and the sender should be the Owner of
/// the asset `collection`.
/// the `collection`.
///
/// If the origin is `Signed`, then funds of signer are reserved according to the formula:
/// `MetadataDepositBase + DepositPerByte * data.len` taking into
Expand Down Expand Up @@ -1285,7 +1285,7 @@ pub mod pallet {
/// Clear the metadata for an assets collection.
///
/// Origin must be either `ForceOrigin` or `Signed` and the sender should be the Owner of
/// the asset `collection`.
/// the `collection`.
///
/// Any deposit is freed for the assets collection owner.
///
Expand Down