diff --git a/crates/matrix-sdk-crypto/src/identities/user.rs b/crates/matrix-sdk-crypto/src/identities/user.rs index 925ff855492..bb8209439d0 100644 --- a/crates/matrix-sdk-crypto/src/identities/user.rs +++ b/crates/matrix-sdk-crypto/src/identities/user.rs @@ -1283,7 +1283,12 @@ pub(crate) mod testing { /// signature_upload_request will be the result of calling /// [`super::OtherUserIdentity::verify`]. /// - /// msk_json should be JSON like: { + /// # Example + /// + /// ```no_run + /// let signature_upload_request = their_identity.verify().await.unwrap(); + /// + /// let msk_json = json!({ /// "their_user_id": { /// "keys": { "ed25519:blah": "blah" } /// "signatures": { @@ -1292,9 +1297,9 @@ pub(crate) mod testing { /// "usage": [ "master" ], /// "user_id": "their_user_id" /// } - /// } + /// }); /// - /// ssk_json should be JSON like: { + /// let ssk_json = json!({ /// "their_user_id": { /// "keys": { "ed25519:blah": "blah" }, /// "signatures": { @@ -1303,7 +1308,25 @@ pub(crate) mod testing { /// "usage": [ "self_signing" ], /// "user_id": "their_user_id" /// } - /// } + /// }) + /// + /// let response = simulate_key_query_response_for_verification( + /// signature_upload_request, + /// my_identity, + /// my_user_id, + /// their_user_id, + /// msk_json, + /// ssk_json + /// ).await; + /// + /// olm_machine + /// .mark_request_as_sent( + /// &TransactionId::new(), + /// crate::IncomingResponse::KeysQuery(&kq_response), + /// ) + /// .await + /// .unwrap(); + /// ``` pub fn simulate_key_query_response_for_verification( signature_upload_request: SignatureUploadRequest, my_identity: OwnUserIdentity,