difftreelog
Merge pull request #69 from usetech-llc/feature/NFTPAR-289
in: master
Return error when non-existing admin is removed
1 file changed
pallets/nft/src/lib.rsdiffbeforeafterboth323 CollectionNotFound,323 CollectionNotFound,324 /// Item not exists.324 /// Item not exists.325 TokenNotFound,325 TokenNotFound,326 /// Admin not found327 AdminNotFound,326 /// Arithmetic calculation overflow.328 /// Arithmetic calculation overflow.327 NumOverflow, 329 NumOverflow, 328 /// Account already has admin role.330 /// Account already has admin role.813 let sender = ensure_signed(origin)?;815 let sender = ensure_signed(origin)?;814 Self::check_owner_or_admin_permissions(collection_id, sender)?;816 Self::check_owner_or_admin_permissions(collection_id, sender)?;815816 if <AdminList<T>>::contains_key(collection_id)817 ensure!(<AdminList<T>>::contains_key(collection_id), Error::<T>::AdminNotFound);817 {818818 let mut admin_arr = <AdminList<T>>::get(collection_id);819 let mut admin_arr = <AdminList<T>>::get(collection_id);819 admin_arr.retain(|i| *i != account_id);820 admin_arr.retain(|i| *i != account_id);820 <AdminList<T>>::insert(collection_id, admin_arr);821 <AdminList<T>>::insert(collection_id, admin_arr);821 }822822823 Ok(())823 Ok(())824 }824 }