mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 02:31:03 +00:00
add has_identity (#11197)
* add has_identity * Update frame/identity/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * update * update Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com>
This commit is contained in:
@@ -978,4 +978,10 @@ impl<T: Config> Pallet<T> {
|
||||
.filter_map(|a| SuperOf::<T>::get(&a).map(|x| (a, x.1)))
|
||||
.collect()
|
||||
}
|
||||
|
||||
/// Check if the account has corresponding identity information by the identity field.
|
||||
pub fn has_identity(who: &T::AccountId, fields: u64) -> bool {
|
||||
IdentityOf::<T>::get(who)
|
||||
.map_or(false, |registration| (registration.info.fields().0.bits() & fields) == fields)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user