difftreelog
fix use new weights
in: master
1 file changed
pallets/nft/src/lib.rsdiffbeforeafterboth242 .max(Self::create_item_fungible())242 .max(Self::create_item_fungible())243 .max(Self::create_item_refungible(data))243 .max(Self::create_item_refungible(data))244 }244 }245 fn create_multiple_items(amount: u32) -> Weight {246 Self::create_multiple_items_nft(amount)247 .max(Self::create_multiple_items_fungible(amount))248 .max(Self::create_multiple_items_refungible(amount))249 }245 fn burn_item() -> Weight {250 fn burn_item() -> Weight {246 // TODO: refungible, fungible251 // TODO: refungible, fungible247 Self::burn_item_nft()252 Self::burn_item_nft()887 /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].892 /// * itemsData: Array items properties. Each property is an array of bytes itself, see [create_item].888 ///893 ///889 /// * owner: Address, initial owner of the NFT.894 /// * owner: Address, initial owner of the NFT.890 #[weight = <SelfWeightOf<T>>::create_item(items_data.iter()895 #[weight = <SelfWeightOf<T>>::create_multiple_items(items_data.len() as u32)]891 .map(|data| { data.data_size() as u32 })892 .sum())]893 #[transactional]896 #[transactional]894 pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResult {897 pub fn create_multiple_items(origin, collection_id: CollectionId, owner: T::CrossAccountId, items_data: Vec<CreateItemData>) -> DispatchResult {895898915 /// * collection_id: ID of the collection.918 /// * collection_id: ID of the collection.916 ///919 ///917 /// * value: New flag value.920 /// * value: New flag value.918 #[weight = <SelfWeightOf<T>>::burn_item()]921 #[weight = <SelfWeightOf<T>>::set_transfers_enabled_flag()]919 #[transactional]922 #[transactional]920 pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult {923 pub fn set_transfers_enabled_flag(origin, collection_id: CollectionId, value: bool) -> DispatchResult {921924