git.delta.rocks / unique-network / refs/commits / 442d14a2f734

difftreelog

fix mint_with_props_weight

Daniel Shiposha2023-10-13parent: #ae91353.patch.diff
in: master

2 files changed

modifiedpallets/nonfungible/src/common.rsdiffbeforeafterboth
--- a/pallets/nonfungible/src/common.rs
+++ b/pallets/nonfungible/src/common.rs
@@ -110,12 +110,16 @@
 	}
 }
 
+/// Weight of minting tokens with properties
+/// * `create_no_data_weight` -- the weight of minting without properties
+/// * `token_properties_nums` -- number of properties of each token
+#[inline]
 pub(crate) fn mint_with_props_weight<T: Config>(
 	create_no_data_weight: Weight,
-	tokens: impl Iterator<Item = u32> + Clone,
+	token_properties_nums: impl Iterator<Item = u32> + Clone,
 ) -> Weight {
 	create_no_data_weight.saturating_add(write_token_properties_total_weight::<T, _>(
-		tokens,
+		token_properties_nums,
 		<SelfWeightOf<T>>::write_token_properties,
 	))
 }
modifiedpallets/refungible/src/common.rsdiffbeforeafterboth
130 }130 }
131}131}
132132
133/// Weight of minting tokens with properties
134/// * `create_no_data_weight` -- the weight of minting without properties
135/// * `token_properties_nums` -- number of properties of each token
136#[inline]
133pub(crate) fn mint_with_props_weight<T: Config>(137pub(crate) fn mint_with_props_weight<T: Config>(
134 create_no_data_weight: Weight,138 create_no_data_weight: Weight,
135 tokens: impl Iterator<Item = u32> + Clone,139 token_properties_nums: impl Iterator<Item = u32> + Clone,
136) -> Weight {140) -> Weight {
137 create_no_data_weight.saturating_add(write_token_properties_total_weight::<T, _>(141 create_no_data_weight.saturating_add(write_token_properties_total_weight::<T, _>(
138 tokens,142 token_properties_nums,
139 <SelfWeightOf<T>>::write_token_properties,143 <SelfWeightOf<T>>::write_token_properties,
140 ))144 ))
141}145}