Improve has good jugement (#13952)

* improve run_benchmark

* Revert "improve run_benchmark"

This reverts commit 4d9cf7a63e37fedca376d692f1461486d3dca659.

* improve has_good_judgement

* Update bin/node/runtime/src/impls.rs

* ".git/.scripts/commands/fmt/fmt.sh"

---------

Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: command-bot <>
This commit is contained in:
Mike Ruje
2023-04-19 11:03:56 +02:00
committed by GitHub
parent 43f9fd9357
commit d9ad6feac0
+7 -9
View File
@@ -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)
.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> {