From a1ee59a87cdeb08d1c69c753dc3d34cd65d15ffe Mon Sep 17 00:00:00 2001 From: str-mv Date: Fri, 26 Jun 2020 10:40:10 +0000 Subject: [PATCH] Safe transfer update --- --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -114,9 +114,7 @@ let who = ensure_signed(origin)?; // Generate next collection ID - let next_id = NextCollectionID::get() - .checked_add(1) - .expect("collection id error") - 1; + let next_id = NextCollectionID::get(); NextCollectionID::put(next_id); @@ -249,7 +247,7 @@ data: properties, }; - let current_index = ::get(collection_id) + 1; + let current_index = ::get(collection_id); ::insert(collection_id, current_index); >::insert((collection_id, current_index), new_item); @@ -395,6 +393,8 @@ let list_itm = >::get((collection_id, item_id)); ensure!(list_itm.contains(&new_owner.clone()), no_perm_mes); + // on_nft_received call + Self::transfer(origin, collection_id, item_id, new_owner)?; Ok(()) -- gitstuff