File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
crates/matrix-sdk-crypto/src/olm Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -289,7 +289,7 @@ mod tests {
289
289
use assert_matches2:: assert_let;
290
290
use matrix_sdk_test:: async_test;
291
291
use ruma:: { device_id, user_id} ;
292
- use serde_json;
292
+ use serde_json:: { self , Value } ;
293
293
use vodozemac:: olm:: { OlmMessage , SessionConfig } ;
294
294
295
295
use crate :: {
@@ -352,9 +352,16 @@ mod tests {
352
352
)
353
353
. unwrap ( ) ;
354
354
355
- // Also ensure that the encrypted payload has the device keys.
356
- let plaintext: DecryptedOlmV1Event < DummyEventContent > =
355
+ // Also ensure that the encrypted payload has the device keys under the unstable prefix
356
+ let plaintext: Value = serde_json:: from_str ( & bob_session_result. plaintext ) . unwrap ( ) ;
357
+ assert_eq ! (
358
+ plaintext[ "org.matrix.msc4147.device_keys" ] [ "user_id" ] . as_str( ) ,
359
+ Some ( "@alice:localhost" )
360
+ ) ;
361
+
362
+ // And the serialized object matches the format as specified in DecryptedOlmV1Event
363
+ let event: DecryptedOlmV1Event < DummyEventContent > =
357
364
serde_json:: from_str ( & bob_session_result. plaintext ) . unwrap ( ) ;
358
- assert_eq ! ( plaintext . device_keys. unwrap( ) , alice. device_keys( ) ) ;
365
+ assert_eq ! ( event . device_keys. unwrap( ) , alice. device_keys( ) ) ;
359
366
}
360
367
}
You can’t perform that action at this time.
0 commit comments