Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add extra check for getting identity history #1438

Merged
merged 2 commits into from
Nov 26, 2024
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
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
Loading