Skip to content
Snippets Groups Projects

tests(live): add sanity tests against gdev live chain

Merged Éloïs requested to merge elois-live-sanity-tests into master
1 file
+ 14
10
Compare changes
  • Side-by-side
  • Inline
@@ -203,19 +203,23 @@ mod verifier {
@@ -203,19 +203,23 @@ mod verifier {
) -> anyhow::Result<()> {
) -> anyhow::Result<()> {
for (idty_index, idty_value) in identities {
for (idty_index, idty_value) in identities {
// Rule 1: each identity should have an account
// Rule 1: each identity should have an account
let idty_account = accounts
let maybe_account = accounts.get(&idty_value.owner_key);
.get(&idty_value.owner_key)
.unwrap_or_else(|| panic!("Identity {} has no account", idty_index));
// Rule 2: each identity account should be sufficient
self.assert(
self.assert(
idty_account.sufficients > 0,
maybe_account.is_some(),
format!(
format!("Identity {} has no account", idty_index),
"Identity {} is corrupted: idty_account.sufficients == 0",
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 {
match idty_value.status {
IdtyStatus::Validated => {
IdtyStatus::Validated => {
// Rule 3: If the identity is validated, removable_on shoud be zero
// Rule 3: If the identity is validated, removable_on shoud be zero
Loading