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

Crypto: add helper methods to UserIdentities #3847

Merged
merged 2 commits into from
Aug 16, 2024
Merged

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Aug 15, 2024

We have a bunch of methods which are the same in both OtherUserIdentity and OwnUserIdentity, so add some convenience methods to access them.

@richvdh richvdh force-pushed the rav/own_verification_violation branch from 301595e to 9b66b62 Compare August 16, 2024 11:14
@richvdh richvdh force-pushed the rav/user_identity_helpers branch from ce3e08c to 8dbfcda Compare August 16, 2024 11:14
@richvdh richvdh force-pushed the rav/own_verification_violation branch from 64ac50a to ae2f0f7 Compare August 16, 2024 13:51
Base automatically changed from rav/own_verification_violation to main August 16, 2024 14:07
@richvdh richvdh force-pushed the rav/user_identity_helpers branch from 8dbfcda to e9dc0ba Compare August 16, 2024 14:28
We have a bunch of methods which are the same in both `OtherUserIdentity` and
`OwnUserIdentity`, so add some convenience methods to access them.
@richvdh richvdh force-pushed the rav/user_identity_helpers branch 2 times, most recently from 580c489 to 9102ef9 Compare August 16, 2024 14:41
@richvdh richvdh marked this pull request as ready for review August 16, 2024 14:45
@richvdh richvdh requested review from a team as code owners August 16, 2024 14:45
@richvdh richvdh requested review from andybalaam and removed request for a team August 16, 2024 14:45
Copy link

codecov bot commented Aug 16, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 2 lines in your changes missing coverage. Please review.

Project coverage is 84.13%. Comparing base (b4d265e) to head (93ca5fe).
Report is 2 commits behind head on main.

Files Patch % Lines
crates/matrix-sdk-crypto/src/identities/user.rs 87.50% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3847      +/-   ##
==========================================
+ Coverage   84.10%   84.13%   +0.02%     
==========================================
  Files         262      262              
  Lines       27637    27651      +14     
==========================================
+ Hits        23245    23263      +18     
+ Misses       4392     4388       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@andybalaam andybalaam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good; 2 questions.

@@ -2213,43 +2208,30 @@ pub(crate) mod tests {
let own_identity =
machine.get_identity(DataSet::own_id(), None).await.unwrap().unwrap().own().unwrap();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line looks similar: can it be simplified too?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no. We need to call own_identity.is_identity_signed(); is_identity_signed is specific to OwnUserIdentity.

crates/matrix-sdk-crypto/src/identities/manager.rs Outdated Show resolved Hide resolved
... instead of lots of `match` and `own()` and `other()`.
@richvdh richvdh force-pushed the rav/user_identity_helpers branch from 67b221a to 93ca5fe Compare August 16, 2024 15:40
@richvdh richvdh enabled auto-merge (rebase) August 16, 2024 15:40
@richvdh richvdh merged commit b497577 into main Aug 16, 2024
40 checks passed
@richvdh richvdh deleted the rav/user_identity_helpers branch August 16, 2024 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants