From cd0ba0dd6b59fe9eb89874429052be99cc8afbb5 Mon Sep 17 00:00:00 2001 From: Gregory Simonov Date: Tue, 06 Dec 2022 22:30:12 +0000 Subject: [PATCH] Apply suggestions from code review --- --- a/pallets/common/src/lib.rs +++ b/pallets/common/src/lib.rs @@ -472,7 +472,7 @@ u128, ), - /// Amount pieces of token owned by `sender` was approved for `spender`. + /// A `sender` approves operations on all owned tokens for `spender`. ApprovedForAll( /// Id of collection to which item is belong. CollectionId, @@ -480,7 +480,7 @@ T::CrossAccountId, /// Id for which operator status was granted or rewoked. T::CrossAccountId, - /// Is operator status was granted or rewoked. + /// Is operator status granted or revoked? bool, ), @@ -1847,7 +1847,7 @@ /// An operator is allowed to transfer all tokens of the sender on their behalf. /// * `owner` - Token owner /// * `operator` - Operator - /// * `approve` - Is operator enabled or disabled + /// * `approve` - Should operator status be granted or revoked? fn set_approval_for_all( &self, owner: T::CrossAccountId, @@ -1855,7 +1855,7 @@ approve: bool, ) -> DispatchResultWithPostInfo; - /// Tells whether an operator is approved by a given owner. + /// Tells whether the given `owner` approves the `operator`. fn is_approved_for_all(&self, owner: T::CrossAccountId, operator: T::CrossAccountId) -> bool; } --- a/pallets/nonfungible/src/erc.rs +++ b/pallets/nonfungible/src/erc.rs @@ -470,7 +470,7 @@ } /// @notice Sets or unsets the approval of a given operator. - /// An operator is allowed to transfer all tokens of the sender on their behalf. + /// The `operator` is allowed to transfer all tokens of the `caller` on their behalf. /// @param operator Operator /// @param approved Is operator enabled or disabled #[weight(>::set_approval_for_all())] --- a/pallets/nonfungible/src/lib.rs +++ b/pallets/nonfungible/src/lib.rs @@ -281,7 +281,7 @@ Key, ), Value = bool, - QueryKind = OptionQuery, + QueryKind = ValueQuery, >; /// Upgrade from the old schema to properties. -- gitstuff