git.delta.rocks / unique-network / refs/commits / 2489f62d5707

difftreelog

Merge pull request #833 from UniqueNetwork/fix/fix-warnings

Yaroslav Bolyukin2023-01-18parents: #916ae42 #06c44dd.patch.diff
in: master

3 files changed

modifiedpallets/common/src/lib.rsdiffbeforeafterboth
--- a/pallets/common/src/lib.rs
+++ b/pallets/common/src/lib.rs
@@ -500,8 +500,16 @@
 		}
 	}
 
+	impl<T: Config> Pallet<T> {
+		/// Helper function that handles deposit events
+		pub fn deposit_event(event: Event<T>) {
+			let event = <T as Config>::RuntimeEvent::from(event);
+			let event = event.into();
+			<frame_system::Pallet<T>>::deposit_event(event)
+		}
+	}
+
 	#[pallet::event]
-	#[pallet::generate_deposit(pub fn deposit_event)]
 	pub enum Event<T: Config> {
 		/// New collection was created
 		CollectionCreated(
modifiedpallets/evm-contract-helpers/src/lib.rsdiffbeforeafterboth
69 }69 }
7070
71 #[pallet::pallet]71 #[pallet::pallet]
72 #[pallet::generate_store(pub(super) trait Store)]72 #[pallet::generate_store(trait Store)]
73 pub struct Pallet<T>(_);73 pub struct Pallet<T>(_);
7474
75 /// Store owner for contract.75 /// Store owner for contract.
80 pub(super) type Owner<T: Config> =80 pub(super) type Owner<T: Config> =
81 StorageMap<Hasher = Twox128, Key = H160, Value = H160, QueryKind = ValueQuery>;81 StorageMap<Hasher = Twox128, Key = H160, Value = H160, QueryKind = ValueQuery>;
8282
83 /// Deprecated: this storage is deprecated
83 #[pallet::storage]84 #[pallet::storage]
84 #[deprecated]
85 pub(super) type SelfSponsoring<T: Config> =85 type SelfSponsoring<T: Config> =
86 StorageMap<Hasher = Twox128, Key = H160, Value = bool, QueryKind = ValueQuery>;86 StorageMap<Hasher = Twox128, Key = H160, Value = bool, QueryKind = ValueQuery>;
8787
88 /// Store for contract sponsorship state.88 /// Store for contract sponsorship state.
349 }349 }
350350
351 /// Get current sponsoring mode, performing lazy migration from legacy storage351 /// Get current sponsoring mode, performing lazy migration from legacy storage
352 /// Deprecated: this method is for deprecated storage
352 pub fn sponsoring_mode(contract: H160) -> SponsoringModeT {353 pub fn sponsoring_mode(contract: H160) -> SponsoringModeT {
353 <SponsoringMode<T>>::get(contract)354 <SponsoringMode<T>>::get(contract)
354 .or_else(|| {355 .or_else(|| {
359 }360 }
360361
361 /// Reconfigure contract sponsoring mode362 /// Reconfigure contract sponsoring mode
363 /// Deprecated: this method is for deprecated storage
362 pub fn set_sponsoring_mode(contract: H160, mode: SponsoringModeT) {364 pub fn set_sponsoring_mode(contract: H160, mode: SponsoringModeT) {
363 if mode == SponsoringModeT::Disabled {365 if mode == SponsoringModeT::Disabled {
364 <SponsoringMode<T>>::remove(contract);366 <SponsoringMode<T>>::remove(contract);
modifiedpallets/unique/src/lib.rsdiffbeforeafterboth
--- a/pallets/unique/src/lib.rs
+++ b/pallets/unique/src/lib.rs
@@ -266,10 +266,12 @@
 		/// * `token_prefix`: Byte string containing the token prefix to mark a collection
 		/// to which a token belongs (limit [`MAX_TOKEN_PREFIX_LENGTH`]).
 		/// * `mode`: Type of items stored in the collection and type dependent data.
-		// returns collection ID
+		///
+		/// returns collection ID
+		///
+		/// Deprecated: `create_collection_ex` is more up-to-date and advanced, prefer it instead.
 		#[weight = <SelfWeightOf<T>>::create_collection()]
-		#[deprecated(note = "`create_collection_ex` is more up-to-date and advanced, prefer it instead")]
-		pub fn create_collection(
+		fn create_collection(
 			origin,
 			collection_name: BoundedVec<u16, ConstU32<MAX_COLLECTION_NAME_LENGTH>>,
 			collection_description: BoundedVec<u16, ConstU32<MAX_COLLECTION_DESCRIPTION_LENGTH>>,