Page MenuHomePhabricator

D12342.id41235.diff
No OneTemporary

D12342.id41235.diff

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
@@ -65,7 +65,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();
@@ -147,7 +147,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

Mime Type
text/plain
Expires
Fri, Dec 13, 4:54 PM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2650879
Default Alt Text
D12342.id41235.diff (3 KB)

Event Timeline