Skip to content

Commit

Permalink
refactor(crypto) Rename device methods in IdentityChangeDataSet to ma…
Browse files Browse the repository at this point in the history
…tch identity names
  • Loading branch information
andybalaam committed Oct 28, 2024
1 parent a1a4ce0 commit 91fa166
Showing 1 changed file with 6 additions and 18 deletions.
24 changes: 6 additions & 18 deletions crates/matrix-sdk-crypto/src/identities/manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2098,12 +2098,8 @@ pub(crate) mod tests {
// We should now have an identity for the user but no pin violation
// (pinned master key is the current one)
assert!(!other_identity.has_pin_violation());
let first_device = manager
.store
.get_device_data(other_user, DataSet::first_device_id())
.await
.unwrap()
.unwrap();
let first_device =
manager.store.get_device_data(other_user, DataSet::device_a()).await.unwrap().unwrap();
assert!(first_device.is_cross_signed_by_owner(&identity));

// We receive a new keys update for that user, with a new identity
Expand All @@ -2122,23 +2118,15 @@ pub(crate) mod tests {
// violation
assert!(other_identity.has_pin_violation());

let second_device = manager
.store
.get_device_data(other_user, DataSet::second_device_id())
.await
.unwrap()
.unwrap();
let second_device =
manager.store.get_device_data(other_user, DataSet::device_b()).await.unwrap().unwrap();

// There is a new device signed by the new identity
assert!(second_device.is_cross_signed_by_owner(&identity));

// The first device should not be signed by the new identity
let first_device = manager
.store
.get_device_data(other_user, DataSet::first_device_id())
.await
.unwrap()
.unwrap();
let first_device =
manager.store.get_device_data(other_user, DataSet::device_a()).await.unwrap().unwrap();
assert!(!first_device.is_cross_signed_by_owner(&identity));

let remember_previous_identity = other_identity.clone();
Expand Down

0 comments on commit 91fa166

Please sign in to comment.