Skip to content

Commit

Permalink
chore: add extra checks
Browse files Browse the repository at this point in the history
  • Loading branch information
itsyaasir committed Nov 25, 2024
1 parent 1b49cf0 commit 3ebbba0
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions identity_iota_core/tests/e2e/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,14 @@ async fn can_get_historical_identity_data() -> anyhow::Result<()> {

let versions: Vec<SequenceNumber> = history.iter().map(|elem| elem.version).collect();
let version_numbers: Vec<usize> = versions.iter().map(|v| (*v).into()).collect();
let oldest_version: usize = *version_numbers.last().unwrap();
let version_diffs: Vec<usize> = version_numbers.iter().map(|v| v - oldest_version).collect();
assert_eq!(version_diffs, vec![1, 0],);

// Check that we have 2 versions (original and updated)
assert_eq!(version_numbers.len(), 2);
// Check that versions are in descending order (newest to oldest)
assert!(
version_numbers[0] > version_numbers[1],
"versions should be in descending order"
);

// paging:
// you can either loop until no result is returned
Expand Down

0 comments on commit 3ebbba0

Please sign in to comment.