Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
improve has_good_judgement
  • Loading branch information
itmilos committed Apr 17, 2023
commit 2f04bed856a7194e238e7281a118d23ca1a8da55
17 changes: 7 additions & 10 deletions bin/node/runtime/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,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)
.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