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
110 }110 }
111}111}
112112
113/// Weight of minting tokens with properties
114/// * `create_no_data_weight` -- the weight of minting without properties
115/// * `token_properties_nums` -- number of properties of each token
116#[inline]
113pub(crate) fn mint_with_props_weight<T: Config>(117pub(crate) fn mint_with_props_weight<T: Config>(
114 create_no_data_weight: Weight,118 create_no_data_weight: Weight,
115 tokens: impl Iterator<Item = u32> + Clone,119 token_properties_nums: impl Iterator<Item = u32> + Clone,
116) -> Weight {120) -> Weight {
117 create_no_data_weight.saturating_add(write_token_properties_total_weight::<T, _>(121 create_no_data_weight.saturating_add(write_token_properties_total_weight::<T, _>(
118 tokens,122 token_properties_nums,
119 <SelfWeightOf<T>>::write_token_properties,123 <SelfWeightOf<T>>::write_token_properties,
120 ))124 ))
121}125}
modifiedpallets/refungible/src/common.rsdiffbeforeafterboth
--- a/pallets/refungible/src/common.rs
+++ b/pallets/refungible/src/common.rs
@@ -130,12 +130,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,
 	))
 }