Skip to content

Commit

Permalink
crypto: rename Account::generate_one_time_keys_helper to `generate_…
Browse files Browse the repository at this point in the history
…one_time_keys`
  • Loading branch information
bnjbvr committed Jan 11, 2024
1 parent 96b13da commit dd48b53
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions crates/matrix-sdk-crypto/src/olm/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ impl Account {
}

/// Generate count number of one-time keys.
pub fn generate_one_time_keys_helper(&mut self, count: usize) -> OneTimeKeyGenerationResult {
pub fn generate_one_time_keys(&mut self, count: usize) -> OneTimeKeyGenerationResult {
self.inner.generate_one_time_keys(count)
}

Expand Down Expand Up @@ -531,7 +531,7 @@ impl Account {
let key_count = (max_keys as u64) - count;
let key_count: usize = key_count.try_into().unwrap_or(max_keys);

let result = self.generate_one_time_keys_helper(key_count);
let result = self.generate_one_time_keys(key_count);

debug!(
count = key_count,
Expand Down Expand Up @@ -986,7 +986,7 @@ impl Account {
) -> (Session, Session) {
use ruma::events::dummy::ToDeviceDummyEventContent;

other.generate_one_time_keys_helper(1);
other.generate_one_time_keys(1);
let one_time_map = other.signed_one_time_keys();
let device = ReadOnlyDevice::from_account(other);

Expand Down
6 changes: 3 additions & 3 deletions crates/matrix-sdk-crypto/src/olm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ pub(crate) mod tests {
let alice = Account::with_device_id(alice_id(), alice_device_id());
let mut bob = Account::with_device_id(bob_id(), bob_device_id());

bob.generate_one_time_keys_helper(1);
bob.generate_one_time_keys(1);
let one_time_key = *bob.one_time_keys().values().next().unwrap();
let sender_key = bob.identity_keys().curve25519;
let session = alice.create_outbound_session_helper(
Expand Down Expand Up @@ -116,7 +116,7 @@ pub(crate) mod tests {
assert!(!one_time_keys.is_empty());
assert_ne!(account.max_one_time_keys(), 0);

account.generate_one_time_keys_helper(10);
account.generate_one_time_keys(10);
let one_time_keys = account.one_time_keys();

assert_ne!(one_time_keys.values().len(), 0);
Expand All @@ -133,7 +133,7 @@ pub(crate) mod tests {
let mut alice = Account::with_device_id(alice_id(), alice_device_id());
let bob = Account::with_device_id(bob_id(), bob_device_id());
let alice_keys = alice.identity_keys();
alice.generate_one_time_keys_helper(1);
alice.generate_one_time_keys(1);
let one_time_keys = alice.one_time_keys();
alice.mark_keys_as_published();

Expand Down
6 changes: 3 additions & 3 deletions crates/matrix-sdk-crypto/src/session_manager/sessions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ mod tests {

assert!(request.one_time_keys.contains_key(bob.user_id()));

bob.generate_one_time_keys_helper(1);
bob.generate_one_time_keys(1);
let one_time = bob.signed_one_time_keys();
assert!(!one_time.is_empty());
bob.mark_keys_as_published();
Expand Down Expand Up @@ -882,7 +882,7 @@ mod tests {

assert!(request.one_time_keys.contains_key(bob.user_id()));

bob.generate_one_time_keys_helper(1);
bob.generate_one_time_keys(1);
let one_time = bob.signed_one_time_keys();
assert!(!one_time.is_empty());
bob.mark_keys_as_published();
Expand Down Expand Up @@ -1009,7 +1009,7 @@ mod tests {
// Since alice is timed out, we won't claim keys for her.
assert!(manager.get_missing_sessions(iter::once(alice)).await.unwrap().is_none());

alice_account.generate_one_time_keys_helper(1);
alice_account.generate_one_time_keys(1);
let one_time = alice_account.signed_one_time_keys();
assert!(!one_time.is_empty());

Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-crypto/src/store/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ macro_rules! cryptostore_integration_tests {
let alice = Account::with_device_id(alice_id(), alice_device_id());
let mut bob = Account::with_device_id(bob_id(), bob_device_id());

bob.generate_one_time_keys_helper(1);
bob.generate_one_time_keys(1);
let one_time_key = *bob.one_time_keys().values().next().unwrap();
let sender_key = bob.identity_keys().curve25519;
let session = alice
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk/src/sliding_sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ impl SlidingSync {
let client = self.inner.client.clone();
let e2ee_uploads = spawn(async move {
if let Err(error) = client.send_outgoing_requests().await {
error!(?error, "Error while sending outoging E2EE requests");
error!(?error, "Error while sending outgoing E2EE requests");
}
})
// Ensure that the task is not running in detached mode. It is aborted when it's
Expand Down

0 comments on commit dd48b53

Please sign in to comment.