From 5ca51b5e533700817ea709f6977d7e0728e9652e Mon Sep 17 00:00:00 2001 From: Daniel Shiposha Date: Sun, 05 Jun 2022 22:55:19 +0000 Subject: [PATCH] fix(rmrk): use ensure --- --- a/pallets/proxy-rmrk-core/src/lib.rs +++ b/pallets/proxy-rmrk-core/src/lib.rs @@ -389,17 +389,15 @@ let collection = Self::get_typed_nft_collection(collection_id, misc::CollectionType::Regular)?; - if !Self::get_nft_property_decoded(collection_id, nft_id, RmrkProperty::Transferable)? { - return Err(>::NonTransferable.into()); - } + ensure!( + Self::get_nft_property_decoded(collection_id, nft_id, RmrkProperty::Transferable)?, + >::NonTransferable + ); - if Self::get_nft_property_decoded( - collection_id, - nft_id, - RmrkProperty::PendingNftAccept, - )? { - return Err(>::NoPermission.into()); - } + ensure!( + !Self::get_nft_property_decoded(collection_id, nft_id, RmrkProperty::PendingNftAccept)?, + >::NoPermission + ); let target_owner; -- gitstuff