difftreelog
chore rename `set_allowance_for` to `set_allowance_from`
in: master
9 files changed
pallets/fungible/src/benchmarking.rsdiffbeforeafterboth90 };90 };91 let owner_eth = T::CrossAccountId::from_eth(*sender.as_eth());91 let owner_eth = T::CrossAccountId::from_eth(*sender.as_eth());92 <Pallet<T>>::create_item(&collection, &owner, (owner_eth.clone(), 200), &Unlimited)?;92 <Pallet<T>>::create_item(&collection, &owner, (owner_eth.clone(), 200), &Unlimited)?;93 }: {<Pallet<T>>::set_allowance_for(&collection, &sender, &owner_eth, &spender, 100)?}93 }: {<Pallet<T>>::set_allowance_from(&collection, &sender, &owner_eth, &spender, 100)?}949495 transfer_from {95 transfer_from {96 bench_init!{96 bench_init!{pallets/fungible/src/common.rsdiffbeforeafterboth272 );272 );273273274 with_weight(274 with_weight(275 <Pallet<T>>::set_allowance_for(self, &sender, &from, &to, amount),275 <Pallet<T>>::set_allowance_from(self, &sender, &from, &to, amount),276 <CommonWeights<T>>::approve_from(),276 <CommonWeights<T>>::approve_from(),277 )277 )278 }278 }pallets/fungible/src/lib.rsdiffbeforeafterboth620 /// - `from`: Owner's eth mirror.620 /// - `from`: Owner's eth mirror.621 /// - `to`: Recipient of the allowance rights.621 /// - `to`: Recipient of the allowance rights.622 /// - `amount`: Amount of tokens the spender is allowed to `transfer` or `burn`.622 /// - `amount`: Amount of tokens the spender is allowed to `transfer` or `burn`.623 pub fn set_allowance_for(623 pub fn set_allowance_from(624 collection: &FungibleHandle<T>,624 collection: &FungibleHandle<T>,625 sender: &T::CrossAccountId,625 sender: &T::CrossAccountId,626 from: &T::CrossAccountId,626 from: &T::CrossAccountId,pallets/nonfungible/src/benchmarking.rsdiffbeforeafterboth141 };141 };142 let owner_eth = T::CrossAccountId::from_eth(*sender.as_eth());142 let owner_eth = T::CrossAccountId::from_eth(*sender.as_eth());143 let item = create_max_item(&collection, &owner, owner_eth.clone())?;143 let item = create_max_item(&collection, &owner, owner_eth.clone())?;144 }: {<Pallet<T>>::set_allowance_for(&collection, &sender, &owner_eth, item, Some(&spender))?}144 }: {<Pallet<T>>::set_allowance_from(&collection, &sender, &owner_eth, item, Some(&spender))?}145145146 transfer_from {146 transfer_from {147 bench_init!{147 bench_init!{pallets/nonfungible/src/common.rsdiffbeforeafterboth369369370 with_weight(370 with_weight(371 if amount == 1 {371 if amount == 1 {372 <Pallet<T>>::set_allowance_for(self, &sender, &from, token, Some(&to))372 <Pallet<T>>::set_allowance_from(self, &sender, &from, token, Some(&to))373 } else {373 } else {374 <Pallet<T>>::set_allowance_for(self, &sender, &from, token, None)374 <Pallet<T>>::set_allowance_from(self, &sender, &from, token, None)375 },375 },376 <CommonWeights<T>>::approve_from(),376 <CommonWeights<T>>::approve_from(),377 )377 )pallets/nonfungible/src/lib.rsdiffbeforeafterboth1176 /// - `from`: Address of sender's eth mirror.1176 /// - `from`: Address of sender's eth mirror.1177 /// - `to`: Adress of spender.1177 /// - `to`: Adress of spender.1178 /// - `token`: Token the spender is allowed to `transfer` or `burn`.1178 /// - `token`: Token the spender is allowed to `transfer` or `burn`.1179 pub fn set_allowance_for(1179 pub fn set_allowance_from(1180 collection: &NonfungibleHandle<T>,1180 collection: &NonfungibleHandle<T>,1181 sender: &T::CrossAccountId,1181 sender: &T::CrossAccountId,1182 from: &T::CrossAccountId,1182 from: &T::CrossAccountId,pallets/refungible/src/benchmarking.rsdiffbeforeafterboth170 };170 };171 let owner_eth = T::CrossAccountId::from_eth(*sender.as_eth());171 let owner_eth = T::CrossAccountId::from_eth(*sender.as_eth());172 let item = create_max_item(&collection, &owner, [(owner_eth.clone(), 200)])?;172 let item = create_max_item(&collection, &owner, [(owner_eth.clone(), 200)])?;173 }: {<Pallet<T>>::set_allowance_for(&collection, &sender, &owner_eth, &spender, item, 100)?}173 }: {<Pallet<T>>::set_allowance_from(&collection, &sender, &owner_eth, &spender, item, 100)?}174174175 transfer_from_normal {175 transfer_from_normal {176 bench_init!{176 bench_init!{pallets/refungible/src/common.rsdiffbeforeafterboth327 amount: u128,327 amount: u128,328 ) -> DispatchResultWithPostInfo {328 ) -> DispatchResultWithPostInfo {329 with_weight(329 with_weight(330 <Pallet<T>>::set_allowance_for(self, &sender, &from, &to, token_id, amount),330 <Pallet<T>>::set_allowance_from(self, &sender, &from, &to, token_id, amount),331 <CommonWeights<T>>::approve_from(),331 <CommonWeights<T>>::approve_from(),332 )332 )333 }333 }pallets/refungible/src/lib.rsdiffbeforeafterboth1107 /// - `from`: Address of sender's eth mirror.1107 /// - `from`: Address of sender's eth mirror.1108 /// - `to`: Adress of spender.1108 /// - `to`: Adress of spender.1109 /// - `amount`: Amount of token pieces the spender is allowed to `transfer` or `burn.1109 /// - `amount`: Amount of token pieces the spender is allowed to `transfer` or `burn.1110 pub fn set_allowance_for(1110 pub fn set_allowance_from(1111 collection: &RefungibleHandle<T>,1111 collection: &RefungibleHandle<T>,1112 sender: &T::CrossAccountId,1112 sender: &T::CrossAccountId,1113 from: &T::CrossAccountId,1113 from: &T::CrossAccountId,