mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 21:01:05 +00:00
registrar: Avoid freebies in provide_judgement (#12465)
* evaluate repatriate reserved error in pallet identity * fix benchmarks * add repatriate reserved error test * benchmark fix * undo lock * include balance to use for benchmarks * rename test * Update frame/identity/src/benchmarking.rs * Update frame/identity/src/benchmarking.rs Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
@@ -144,9 +144,14 @@ benchmarks! {
|
||||
|
||||
// User requests judgement from all the registrars, and they approve
|
||||
for i in 0..r {
|
||||
let registrar: T::AccountId = account("registrar", i, SEED);
|
||||
let registrar_lookup = T::Lookup::unlookup(registrar.clone());
|
||||
let balance_to_use = T::Currency::minimum_balance() * 10u32.into();
|
||||
let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);
|
||||
|
||||
Identity::<T>::request_judgement(caller_origin.clone(), i, 10u32.into())?;
|
||||
Identity::<T>::provide_judgement(
|
||||
RawOrigin::Signed(account("registrar", i, SEED)).into(),
|
||||
RawOrigin::Signed(registrar).into(),
|
||||
i,
|
||||
caller_lookup.clone(),
|
||||
Judgement::Reasonable,
|
||||
@@ -213,9 +218,13 @@ benchmarks! {
|
||||
|
||||
// User requests judgement from all the registrars, and they approve
|
||||
for i in 0..r {
|
||||
let registrar: T::AccountId = account("registrar", i, SEED);
|
||||
let balance_to_use = T::Currency::minimum_balance() * 10u32.into();
|
||||
let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);
|
||||
|
||||
Identity::<T>::request_judgement(caller_origin.clone(), i, 10u32.into())?;
|
||||
Identity::<T>::provide_judgement(
|
||||
RawOrigin::Signed(account("registrar", i, SEED)).into(),
|
||||
RawOrigin::Signed(registrar).into(),
|
||||
i,
|
||||
caller_lookup.clone(),
|
||||
Judgement::Reasonable,
|
||||
@@ -362,9 +371,13 @@ benchmarks! {
|
||||
|
||||
// User requests judgement from all the registrars, and they approve
|
||||
for i in 0..r {
|
||||
let registrar: T::AccountId = account("registrar", i, SEED);
|
||||
let balance_to_use = T::Currency::minimum_balance() * 10u32.into();
|
||||
let _ = T::Currency::make_free_balance_be(®istrar, balance_to_use);
|
||||
|
||||
Identity::<T>::request_judgement(target_origin.clone(), i, 10u32.into())?;
|
||||
Identity::<T>::provide_judgement(
|
||||
RawOrigin::Signed(account("registrar", i, SEED)).into(),
|
||||
RawOrigin::Signed(registrar).into(),
|
||||
i,
|
||||
target_lookup.clone(),
|
||||
Judgement::Reasonable,
|
||||
|
||||
Reference in New Issue
Block a user