git.delta.rocks / unique-network / refs/commits / 9e39d67c9d24

difftreelog

path: remove data_size

Trubnikov Sergey2022-08-02parent: #3a3be8f.patch.diff
in: master

2 files changed

modifiedprimitives/data-structs/src/lib.rsdiffbeforeafterboth
--- a/primitives/data-structs/src/lib.rs
+++ b/primitives/data-structs/src/lib.rs
@@ -861,13 +861,6 @@
 	RefungibleMultipleOwners(CreateRefungibleExData<CrossAccountId>),
 }
 
-impl CreateItemData {
-	/// Get size of custom data.
-	pub fn data_size(&self) -> usize {
-		0
-	}
-}
-
 impl From<CreateNftData> for CreateItemData {
 	fn from(item: CreateNftData) -> Self {
 		CreateItemData::NFT(item)
modifiedruntime/common/src/sponsoring.rsdiffbeforeafterboth
156pub fn withdraw_create_item<T: Config>(156pub fn withdraw_create_item<T: Config>(
157 collection: &CollectionHandle<T>,157 collection: &CollectionHandle<T>,
158 who: &T::CrossAccountId,158 who: &T::CrossAccountId,
159 _properties: &CreateItemData,159 properties: &CreateItemData,
160) -> Option<()> {160) -> Option<()> {
161 if _properties.data_size() as u32 > collection.limits.sponsored_data_size() {
162 return None;
163 }
164
165 // sponsor timeout161 // sponsor timeout
166 let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;162 let block_number = <frame_system::Pallet<T>>::block_number() as T::BlockNumber;
167 let limit = collection163 let limit = collection
168 .limits164 .limits
169 .sponsor_transfer_timeout(match _properties {165 .sponsor_transfer_timeout(match properties {
170 CreateItemData::NFT(_) => NFT_SPONSOR_TRANSFER_TIMEOUT,166 CreateItemData::NFT(_) => NFT_SPONSOR_TRANSFER_TIMEOUT,
171 CreateItemData::Fungible(_) => FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,167 CreateItemData::Fungible(_) => FUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,
172 CreateItemData::ReFungible(_) => REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,168 CreateItemData::ReFungible(_) => REFUNGIBLE_SPONSOR_TRANSFER_TIMEOUT,