difftreelog
fix(pallet-identity) benchmarking
in: master
2 files changed
Makefilediffbeforeafterboth146 make _bench PALLET=xcm OUTPUT=./runtime/common/weights/xcm.rs TEMPLATE="--template=.maintain/external-weight-template.hbs"146 make _bench PALLET=xcm OUTPUT=./runtime/common/weights/xcm.rs TEMPLATE="--template=.maintain/external-weight-template.hbs"147147148.PHONY: bench148.PHONY: bench149# Disabled: bench-scheduler, bench-identity149# Disabled: bench-scheduler150bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm bench-collator-selection150bench: bench-app-promotion bench-common bench-evm-migration bench-unique bench-structure bench-fungible bench-refungible bench-nonfungible bench-configuration bench-foreign-assets bench-maintenance bench-xcm bench-collator-selection bench-identity151151152.PHONY: check152.PHONY: check153check:153check:pallets/identity/src/benchmarking.rsdiffbeforeafterboth138 }138 }139}139}140141/// `Currency::minimum_balance` was used originally, but in unique-chain, we have142/// zero existential deposit, thus triggering zero bond assertion.143fn balance_unit<T: Config>() -> <T::Currency as Currency<T::AccountId>>::Balance {144 200u32.into()145}140146141benchmarks! {147benchmarks! {142 add_registrar {148 add_registrar {167 for i in 0..r {173 for i in 0..r {168 let registrar: T::AccountId = account("registrar", i, SEED);174 let registrar: T::AccountId = account("registrar", i, SEED);169 let registrar_lookup = T::Lookup::unlookup(registrar.clone());175 let registrar_lookup = T::Lookup::unlookup(registrar.clone());170 let balance_to_use = T::Currency::minimum_balance() * 10u32.into();176 let balance_to_use = balance_unit::<T>() * 10u32.into();171 let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);177 let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);172178173 Identity::<T>::request_judgement(caller_origin.clone(), i, 10u32.into())?;179 Identity::<T>::request_judgement(caller_origin.clone(), i, 10u32.into())?;240 // User requests judgement from all the registrars, and they approve246 // User requests judgement from all the registrars, and they approve241 for i in 0..r {247 for i in 0..r {242 let registrar: T::AccountId = account("registrar", i, SEED);248 let registrar: T::AccountId = account("registrar", i, SEED);243 let balance_to_use = T::Currency::minimum_balance() * 10u32.into();249 let balance_to_use = balance_unit::<T>() * 10u32.into();244 let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);250 let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);245251246 Identity::<T>::request_judgement(caller_origin.clone(), i, 10u32.into())?;252 Identity::<T>::request_judgement(caller_origin.clone(), i, 10u32.into())?;393 // User requests judgement from all the registrars, and they approve399 // User requests judgement from all the registrars, and they approve394 for i in 0..r {400 for i in 0..r {395 let registrar: T::AccountId = account("registrar", i, SEED);401 let registrar: T::AccountId = account("registrar", i, SEED);396 let balance_to_use = T::Currency::minimum_balance() * 10u32.into();402 let balance_to_use = balance_unit::<T>() * 10u32.into();397 let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);403 let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);398404399 Identity::<T>::request_judgement(target_origin.clone(), i, 10u32.into())?;405 Identity::<T>::request_judgement(target_origin.clone(), i, 10u32.into())?;