git.delta.rocks / unique-network / refs/commits / 175b00bb478d

difftreelog

Remove duplicate methods

str-mv2020-08-04parent: #b683ad2.patch.diff
in: master

1 file changed

modifiedpallets/nft/src/lib.rsdiffbeforeafterboth
538 Ok(()) 538 Ok(())
539 }539 }
540
541 // Shonsorship methods
542 #[weight = 0]
543 pub fn set_collection_sponsor(
544 origin,
545 collection_id: u64,
546 address: T::AccountId
547 ) -> DispatchResult {
548 let sender = ensure_signed(origin)?;
549 Self::check_owner_permissions(collection_id, sender)?;
550 let mut collection = <Collection<T>>::get(collection_id);
551 collection.unconfirmed_sponsor = address;
552 <Collection<T>>::insert(collection_id, collection);
553
554 Ok(())
555 }
556
557 #[weight = 0]
558 pub fn confirm_sponsorship(
559 origin,
560 collection_id: u64,
561 address: T::AccountId
562 ) -> DispatchResult {
563 let sender = ensure_signed(origin)?;
564 let mut collection = <Collection<T>>::get(collection_id);
565
566 ensure!(collection.unconfirmed_sponsor == sender, "Only sponsor can confirm sponsorship");
567
568 collection.sponsor = collection.unconfirmed_sponsor;
569 collection.unconfirmed_sponsor = T::AccountId::default();
570 <Collection<T>>::insert(collection_id, collection);
571
572 Ok(())
573 }
574
575 #[weight = 0]
576 pub fn remove_collection_sponsor(
577 origin,
578 collection_id: u64
579 ) -> DispatchResult {
580 let sender = ensure_signed(origin)?;
581 Self::check_owner_permissions(collection_id, sender)?;
582 let mut collection = <Collection<T>>::get(collection_id);
583 collection.unconfirmed_sponsor = T::AccountId::default();
584 collection.sponsor = T::AccountId::default();
585 <Collection<T>>::insert(collection_id, collection);
586
587 Ok(())
588 }
589
590 }540 }
591}541}