Skip to content

Commit f9cfd74

Browse files
committed
crypto: rename Account::generate_one_time_keys_helper to generate_one_time_keys
1 parent f155ea5 commit f9cfd74

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

crates/matrix-sdk-crypto/src/olm/account.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ impl Account {
464464
}
465465

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

@@ -537,7 +537,7 @@ impl Account {
537537
let key_count = (max_keys as u64) - count;
538538
let key_count: usize = key_count.try_into().unwrap_or(max_keys);
539539

540-
let result = self.generate_one_time_keys_helper(key_count);
540+
let result = self.generate_one_time_keys(key_count);
541541

542542
debug!(
543543
count = key_count,
@@ -992,7 +992,7 @@ impl Account {
992992
) -> (Session, Session) {
993993
use ruma::events::dummy::ToDeviceDummyEventContent;
994994

995-
other.generate_one_time_keys_helper(1);
995+
other.generate_one_time_keys(1);
996996
let one_time_map = other.signed_one_time_keys();
997997
let device = ReadOnlyDevice::from_account(other);
998998

crates/matrix-sdk-crypto/src/olm/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ pub(crate) mod tests {
8585
let alice = Account::with_device_id(alice_id(), alice_device_id());
8686
let mut bob = Account::with_device_id(bob_id(), bob_device_id());
8787

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

119-
account.generate_one_time_keys_helper(10);
119+
account.generate_one_time_keys(10);
120120
let one_time_keys = account.one_time_keys();
121121

122122
assert_ne!(one_time_keys.values().len(), 0);
@@ -133,7 +133,7 @@ pub(crate) mod tests {
133133
let mut alice = Account::with_device_id(alice_id(), alice_device_id());
134134
let bob = Account::with_device_id(bob_id(), bob_device_id());
135135
let alice_keys = alice.identity_keys();
136-
alice.generate_one_time_keys_helper(1);
136+
alice.generate_one_time_keys(1);
137137
let one_time_keys = alice.one_time_keys();
138138
alice.mark_keys_as_published();
139139

crates/matrix-sdk-crypto/src/session_manager/sessions.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ mod tests {
718718

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

721-
bob.generate_one_time_keys_helper(1);
721+
bob.generate_one_time_keys(1);
722722
let one_time = bob.signed_one_time_keys();
723723
assert!(!one_time.is_empty());
724724
bob.mark_keys_as_published();
@@ -882,7 +882,7 @@ mod tests {
882882

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

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

1012-
alice_account.generate_one_time_keys_helper(1);
1012+
alice_account.generate_one_time_keys(1);
10131013
let one_time = alice_account.signed_one_time_keys();
10141014
assert!(!one_time.is_empty());
10151015

crates/matrix-sdk-crypto/src/store/integration_tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ macro_rules! cryptostore_integration_tests {
7979
let alice = Account::with_device_id(alice_id(), alice_device_id());
8080
let mut bob = Account::with_device_id(bob_id(), bob_device_id());
8181

82-
bob.generate_one_time_keys_helper(1);
82+
bob.generate_one_time_keys(1);
8383
let one_time_key = *bob.one_time_keys().values().next().unwrap();
8484
let sender_key = bob.identity_keys().curve25519;
8585
let session = alice

0 commit comments

Comments
 (0)