git.delta.rocks / unique-network / refs/commits / 8d3b0d18cfc9

difftreelog

refactor remove sponsor permissions check

Yaroslav Bolyukin2021-03-03parent: #66c85be.patch.diff
in: master
As sponsor should have no unique permissions in sponsored collection

1 file changed

modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
1876 Ok(())1876 Ok(())
1877 }1877 }
1878
1879 fn check_collection_sponsor(
1880 collection_id: CollectionId,
1881 subject: T::AccountId,
1882 ) -> DispatchResult {
1883 Self::collection_exists(collection_id)?;
1884 let collection = <Collection<T>>::get(collection_id).unwrap();
1885
1886 ensure!(
1887 collection.sponsor_confirmed &&
1888 collection.sponsor == subject,
1889 Error::<T>::NoPermission,
1890 );
1891 Ok(())
1892 }
18931878
1894 fn is_item_owner(subject: T::AccountId, collection_id: CollectionId, item_id: TokenId) -> bool {1879 fn is_item_owner(subject: T::AccountId, collection_id: CollectionId, item_id: TokenId) -> bool {
1895 let target_collection = <Collection<T>>::get(collection_id).unwrap();1880 let target_collection = <Collection<T>>::get(collection_id).unwrap();