difftreelog
Merge pull request #121 from usetech-llc/fix/remove-storage-call-from-collectionlimits-default
in: master
Remove storage call from CollectionLimits Default impl
1 file changed
pallets/nft/src/lib.rsdiffbeforeafterboth194 CollectionLimits { 194 CollectionLimits { 195 account_token_ownership_limit: 10_000_000, 195 account_token_ownership_limit: 10_000_000, 196 token_limit: u32::max_value(),196 token_limit: u32::max_value(),197 sponsored_data_size: ChainLimit::get().custom_data_limit, 197 sponsored_data_size: u32::MAX,198 sponsor_transfer_timeout: 14400,198 sponsor_transfer_timeout: 14400,199 owner_can_transfer: true,199 owner_can_transfer: true,200 owner_can_destroy: true200 owner_can_destroy: true576 _ => 0576 _ => 0577 };577 };578579 let chain_limit = ChainLimit::get();578580579 // bound Total number of collections581 // bound Total number of collections580 ensure!(CollectionCount::get() < ChainLimit::get().collection_numbers_limit, Error::<T>::TotalCollectionsLimitExceeded);582 ensure!(CollectionCount::get() < chain_limit.collection_numbers_limit, Error::<T>::TotalCollectionsLimitExceeded);581583582 // check params584 // check params583 ensure!(decimal_points <= MAX_DECIMAL_POINTS, Error::<T>::CollectionDecimalPointLimitExceeded);585 ensure!(decimal_points <= MAX_DECIMAL_POINTS, Error::<T>::CollectionDecimalPointLimitExceeded);598 CreatedCollectionCount::put(next_id);600 CreatedCollectionCount::put(next_id);599 CollectionCount::put(total);601 CollectionCount::put(total);602603 let limits = CollectionLimits {604 sponsored_data_size: chain_limit.custom_data_limit,605 ..Default::default()606 };600607601 // Create new collection608 // Create new collection602 let new_collection = CollectionType {609 let new_collection = CollectionType {614 sponsor_confirmed: false,621 sponsor_confirmed: false,615 variable_on_chain_schema: Vec::new(),622 variable_on_chain_schema: Vec::new(),616 const_on_chain_schema: Vec::new(),623 const_on_chain_schema: Vec::new(),617 limits: CollectionLimits::default()624 limits,618 };625 };619626620 // Add new collection to map627 // Add new collection to map