Uniques: Reset approved account after transfer (#12145)

* reset approved account

* wrap at 100

* doc

* fmt

* Update frame/uniques/src/tests.rs

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* new test

* Update frame/uniques/src/lib.rs

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>

* fmt

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
This commit is contained in:
Sergej Sakac
2022-09-01 10:45:20 +02:00
committed by GitHub
parent 9bbf8efd02
commit 7f1b9a937a
3 changed files with 48 additions and 0 deletions
+4
View File
@@ -606,6 +606,8 @@ pub mod pallet {
/// Move an item from the sender account to another.
///
/// This resets the approved account of the item.
///
/// Origin must be Signed and the signing account must be either:
/// - the Admin of the `collection`;
/// - the Owner of the `item`;
@@ -914,6 +916,8 @@ pub mod pallet {
/// - `item`: The item of the item to be approved for delegated transfer.
/// - `delegate`: The account to delegate permission to transfer the item.
///
/// Important NOTE: The `approved` account gets reset after each transfer.
///
/// Emits `ApprovedTransfer` on success.
///
/// Weight: `O(1)`