Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3449825
D12342.id41099.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D12342.id41099.diff
View Options
diff --git a/services/commtest/src/identity/device.rs b/services/commtest/src/identity/device.rs
--- a/services/commtest/src/identity/device.rs
+++ b/services/commtest/src/identity/device.rs
@@ -64,7 +64,7 @@
let example_payload = serde_json::to_string(&device_keys)
.expect("Failed to serialize example payload");
// The ed25519 value from the olm payload
- let device_id = &device_keys.primary_identity_public_keys.ed25519;
+ let device_id = device_keys.device_id();
let device_type = device_type.unwrap_or(DeviceType::Keyserver);
let mut client_registration = Registration::new();
@@ -146,7 +146,7 @@
let example_payload = serde_json::to_string(&device_keys)
.expect("Failed to serialize example payload");
// The ed25519 value from the olm payload
- let device_id = &device_keys.primary_identity_public_keys.ed25519;
+ let device_id = device_keys.device_id();
let device_type = device_type.unwrap_or(DeviceType::Keyserver);
let mut client_login = Login::new();
diff --git a/services/commtest/src/identity/olm_account_infos.rs b/services/commtest/src/identity/olm_account_infos.rs
--- a/services/commtest/src/identity/olm_account_infos.rs
+++ b/services/commtest/src/identity/olm_account_infos.rs
@@ -31,8 +31,8 @@
}
}
- pub fn device_id(&self) -> String {
- self.primary_identity_public_keys.ed25519.clone()
+ pub fn device_id(&self) -> &str {
+ &self.primary_identity_public_keys.ed25519
}
}
diff --git a/services/commtest/tests/identity_device_list_tests.rs b/services/commtest/tests/identity_device_list_tests.rs
--- a/services/commtest/tests/identity_device_list_tests.rs
+++ b/services/commtest/tests/identity_device_list_tests.rs
@@ -177,7 +177,7 @@
let first_update: DeviceListHistoryItem = {
let update_payload =
SignedDeviceList::from_raw_unsigned(&RawDeviceList::new(vec![
- primary_device_id.clone(),
+ primary_device_id.to_string(),
"device2".to_string(),
]));
let update_request = UpdateDeviceListRequest::from(&update_payload);
@@ -195,7 +195,7 @@
// now perform a update (remove a device), but sign the device list
let second_update: DeviceListHistoryItem = {
let update_payload = SignedDeviceList::create_signed(
- &RawDeviceList::new(vec![primary_device_id.clone()]),
+ &RawDeviceList::new(vec![primary_device_id.to_string()]),
&mut primary_account,
None,
);
@@ -215,7 +215,7 @@
{
let mut update_payload = SignedDeviceList::create_signed(
&RawDeviceList::new(vec![
- primary_device_id.clone(),
+ primary_device_id.to_string(),
"device3".to_string(),
]),
&mut primary_account,
@@ -240,7 +240,7 @@
get_device_list_history(&mut auth_client, &user.user_id).await;
let expected_devices_lists: Vec<DeviceListHistoryItem> = vec![
- (None, vec![primary_device_id.clone()]), // auto-generated during registration
+ (None, vec![primary_device_id.to_string()]), // auto-generated during registration
first_update,
second_update,
];
@@ -385,7 +385,7 @@
// create signing account
let mut primary_account = SigningCapableAccount::new();
let primary_device_keys = primary_account.public_keys();
- let primary_device_id = primary_device_keys.device_id();
+ let primary_device_id = primary_device_keys.device_id().to_string();
// create initial device list
let raw_device_list = RawDeviceList::new(vec![primary_device_id]);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Dec 13, 4:55 PM (15 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2650961
Default Alt Text
D12342.id41099.diff (3 KB)
Attached To
Mode
D12342: [commtest] Make ClientPublicKeys::device_id() return str slice
Attached
Detach File
Event Timeline
Log In to Comment