From bc2aff4876035669d198ddba9bb11fdd79af0b0a Mon Sep 17 00:00:00 2001 From: Yaroslav Bolyukin Date: Mon, 22 Mar 2021 11:03:33 +0000 Subject: [PATCH] fix: merge changes --- --- a/pallets/nft/src/lib.rs +++ b/pallets/nft/src/lib.rs @@ -174,7 +174,7 @@ pub mint_mode: bool, pub offchain_schema: Vec, pub schema_version: SchemaVersion, - pub sponsorship: SponsorshipState, + pub sponsorship: SponsorshipState, pub limits: CollectionLimits, // Collection private restrictions pub variable_on_chain_schema: Vec, // pub const_on_chain_schema: Vec, // @@ -1853,8 +1853,6 @@ } fn create_item_no_validation(collection: &CollectionHandle, owner: T::AccountId, data: CreateItemData) -> DispatchResult { - let collection_id = collection.id; - match data { CreateItemData::NFT(data) => { @@ -2622,10 +2620,7 @@ // sponsor timeout let block_number = >::block_number() as T::BlockNumber; - let collection = >::get(collection_id); - let limit = collection.limits.sponsor_transfer_timeout; - let mut sponsored = true; if >::contains_key((collection_id, &who)) { let last_tx_block = >::get((collection_id, &who)); let limit_time = last_tx_block + limit.into(); @@ -2636,9 +2631,7 @@ >::insert((collection_id, who.clone()), block_number); // check free create limit - if (collection.limits.sponsored_data_size >= (_properties.len() as u32)) && - (sponsored) - { + if collection.limits.sponsored_data_size >= (_properties.len() as u32) { collection.sponsorship.sponsor() .cloned() } else { @@ -2747,7 +2740,7 @@ let collection = >::get(collection_id)?; if - collection.sponsor_confirmed && + collection.sponsorship.confirmed() && // Can't sponsor fungible collection, this tx will be rejected // as invalid !matches!(collection.mode, CollectionMode::Fungible(_)) && @@ -2769,7 +2762,7 @@ if !sponsor_metadata_changes { None } else { - Some(collection.sponsor) + collection.sponsorship.sponsor().cloned() } } -- gitstuff