mirror of
https://github.com/chatmail/core.git
synced 2026-05-07 08:56:30 +03:00
refactor(e2ee): do not return anything from ensure_secret_key_exists()
The return value was never used.
This commit is contained in:
13
src/e2ee.rs
13
src/e2ee.rs
@@ -144,14 +144,10 @@ impl EncryptHelper {
|
|||||||
/// sent but in a few locations there are no such guarantees,
|
/// sent but in a few locations there are no such guarantees,
|
||||||
/// e.g. when exporting keys, and calling this function ensures a
|
/// e.g. when exporting keys, and calling this function ensures a
|
||||||
/// private key will be present.
|
/// private key will be present.
|
||||||
///
|
|
||||||
/// If this succeeds you are also guaranteed that the
|
|
||||||
/// [Config::ConfiguredAddr] is configured, this address is returned.
|
|
||||||
// TODO, remove this once deltachat::key::Key no longer exists.
|
// TODO, remove this once deltachat::key::Key no longer exists.
|
||||||
pub async fn ensure_secret_key_exists(context: &Context) -> Result<String> {
|
pub async fn ensure_secret_key_exists(context: &Context) -> Result<()> {
|
||||||
let self_addr = context.get_primary_self_addr().await?;
|
|
||||||
SignedPublicKey::load_self(context).await?;
|
SignedPublicKey::load_self(context).await?;
|
||||||
Ok(self_addr)
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
@@ -168,10 +164,7 @@ mod tests {
|
|||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
async fn test_prexisting() {
|
async fn test_prexisting() {
|
||||||
let t = TestContext::new_alice().await;
|
let t = TestContext::new_alice().await;
|
||||||
assert_eq!(
|
assert!(ensure_secret_key_exists(&t).await.is_ok());
|
||||||
ensure_secret_key_exists(&t).await.unwrap(),
|
|
||||||
"alice@example.org"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
|
|||||||
Reference in New Issue
Block a user