difftreelog
fix(rmrk) map CollectionNotEmpty error
in: master
2 files changed
pallets/proxy-rmrk-core/src/lib.rsdiffbeforeafterboth204 misc::CollectionType::Regular,204 misc::CollectionType::Regular,205 )?;205 )?;206207 ensure!(208 collection.total_supply() == 0,209 <Error<T>>::CollectionNotEmpty210 );211206212 <PalletNft<T>>::destroy_collection(collection, &cross_sender)207 <PalletNft<T>>::destroy_collection(collection, &cross_sender)213 .map_err(Self::map_unique_err_to_proxy)?;208 .map_err(Self::map_unique_err_to_proxy)?;1142 CommonError::PublicMintingNotAllowed => NoPermission,1137 CommonError::PublicMintingNotAllowed => NoPermission,1143 CommonError::TokenNotFound => NoAvailableNftId,1138 CommonError::TokenNotFound => NoAvailableNftId,1144 CommonError::ApprovedValueTooLow => NoPermission,1139 CommonError::ApprovedValueTooLow => NoPermission,1140 CommonError::CantDestroyNotEmptyCollection => CollectionNotEmpty,1145 StructureError::TokenNotFound => NoAvailableNftId,1141 StructureError::TokenNotFound => NoAvailableNftId,1146 StructureError::OuroborosDetected => CannotSendToDescendentOrSelf1142 StructureError::OuroborosDetected => CannotSendToDescendentOrSelf,1147 }1143 }1148 }1144 }1149 }1145 }pallets/proxy-rmrk-core/src/misc.rsdiffbeforeafterboth334#[macro_export]4#[macro_export]5macro_rules! map_unique_err_to_proxy {5macro_rules! map_unique_err_to_proxy {6 (match $err:ident { $($unique_err_ty:ident :: $unique_err:ident => $proxy_err:ident),+ }) => {6 (match $err:ident { $($unique_err_ty:ident :: $unique_err:ident => $proxy_err:ident),+ $(,)? }) => {7 $(7 $(8 if $err == <$unique_err_ty<T>>::$unique_err.into() {8 if $err == <$unique_err_ty<T>>::$unique_err.into() {9 return <Error<T>>::$proxy_err.into()9 return <Error<T>>::$proxy_err.into()