Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Improve has good jugement #13952

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions bin/node/runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,13 @@ impl IdentityVerifier<AccountId> for AllianceIdentityVerifier {

fn has_good_judgement(who: &AccountId) -> bool {
use pallet_identity::Judgement;
if let Some(judgements) =
crate::Identity::identity(who).map(|registration| registration.judgements)
{
judgements
.iter()
.any(|(_, j)| matches!(j, Judgement::KnownGood | Judgement::Reasonable))
} else {
false
}
crate::Identity::identity(who)
ggwpez marked this conversation as resolved.
Show resolved Hide resolved
.map(|registration| registration.judgements)
.map_or(false, |judgements| {
judgements
.iter()
.any(|(_, j)| matches!(j, Judgement::KnownGood | Judgement::Reasonable))
})
}

fn super_account_id(who: &AccountId) -> Option<AccountId> {
Expand Down