diff --git a/live-tests/tests/sanity_gdev.rs b/live-tests/tests/sanity_gdev.rs index 6dbfe5b41700728b42bcfed30e444188a2912bc8..978da9d6a7611cd0b084fc8ab8446e3000f28bc8 100644 --- a/live-tests/tests/sanity_gdev.rs +++ b/live-tests/tests/sanity_gdev.rs @@ -203,19 +203,23 @@ mod verifier { ) -> anyhow::Result<()> { for (idty_index, idty_value) in identities { // Rule 1: each identity should have an account - let idty_account = accounts - .get(&idty_value.owner_key) - .unwrap_or_else(|| panic!("Identity {} has no account", idty_index)); - - // Rule 2: each identity account should be sufficient + let maybe_account = accounts.get(&idty_value.owner_key); self.assert( - idty_account.sufficients > 0, - format!( - "Identity {} is corrupted: idty_account.sufficients == 0", - idty_index - ), + maybe_account.is_some(), + format!("Identity {} has no account", idty_index), ); + if let Some(account) = maybe_account { + // Rule 2: each identity account should be sufficient + self.assert( + account.sufficients > 0, + format!( + "Identity {} is corrupted: idty_account.sufficients == 0", + idty_index + ), + ); + } + match idty_value.status { IdtyStatus::Validated => { // Rule 3: If the identity is validated, removable_on shoud be zero