mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-14 06:21:11 +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:
@@ -238,6 +238,8 @@ pub mod pallet {
|
||||
NotOwned,
|
||||
/// The provided judgement was for a different identity.
|
||||
JudgementForDifferentIdentity,
|
||||
/// Error that occurs when there is an issue paying for judgement.
|
||||
JudgementPaymentFailed,
|
||||
}
|
||||
|
||||
#[pallet::event]
|
||||
@@ -788,12 +790,13 @@ pub mod pallet {
|
||||
match id.judgements.binary_search_by_key(®_index, |x| x.0) {
|
||||
Ok(position) => {
|
||||
if let Judgement::FeePaid(fee) = id.judgements[position].1 {
|
||||
let _ = T::Currency::repatriate_reserved(
|
||||
T::Currency::repatriate_reserved(
|
||||
&target,
|
||||
&sender,
|
||||
fee,
|
||||
BalanceStatus::Free,
|
||||
);
|
||||
)
|
||||
.map_err(|_| Error::<T>::JudgementPaymentFailed)?;
|
||||
}
|
||||
id.judgements[position] = item
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user