From 6d51d19f0199e541846ef99009754d75728cc45a Mon Sep 17 00:00:00 2001 From: link2xt Date: Mon, 24 Jul 2023 18:29:03 +0000 Subject: [PATCH] refactor(e2ee): do not return anything from ensure_secret_key_exists() The return value was never used. --- src/e2ee.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/e2ee.rs b/src/e2ee.rs index 160609348..2addaf56d 100644 --- a/src/e2ee.rs +++ b/src/e2ee.rs @@ -144,14 +144,10 @@ impl EncryptHelper { /// sent but in a few locations there are no such guarantees, /// e.g. when exporting keys, and calling this function ensures a /// 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. -pub async fn ensure_secret_key_exists(context: &Context) -> Result { - let self_addr = context.get_primary_self_addr().await?; +pub async fn ensure_secret_key_exists(context: &Context) -> Result<()> { SignedPublicKey::load_self(context).await?; - Ok(self_addr) + Ok(()) } #[cfg(test)] @@ -168,10 +164,7 @@ mod tests { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn test_prexisting() { let t = TestContext::new_alice().await; - assert_eq!( - ensure_secret_key_exists(&t).await.unwrap(), - "alice@example.org" - ); + assert!(ensure_secret_key_exists(&t).await.is_ok()); } #[tokio::test(flavor = "multi_thread", worker_threads = 2)]