From 98c74a120e910b13d3f2bbe30fb0d5a8814cec52 Mon Sep 17 00:00:00 2001 From: Jazz Turner-Baggs <473256+jazzz@users.noreply.github.com> Date: Fri, 6 Feb 2026 13:34:31 -0800 Subject: [PATCH] Clean up warnings --- conversations/src/errors.rs | 2 -- conversations/src/identity.rs | 5 ----- conversations/src/inbox/inbox.rs | 9 +++------ 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/conversations/src/errors.rs b/conversations/src/errors.rs index 5b6b438..d551960 100644 --- a/conversations/src/errors.rs +++ b/conversations/src/errors.rs @@ -24,8 +24,6 @@ pub enum ChatError { #[derive(Error, Debug)] pub enum EncryptionError { - #[error("encryption: {0}")] - Encryption(String), #[error("decryption: {0}")] Decryption(String), } diff --git a/conversations/src/identity.rs b/conversations/src/identity.rs index c5646a7..44dd79e 100644 --- a/conversations/src/identity.rs +++ b/conversations/src/identity.rs @@ -1,4 +1,3 @@ -use blake2::{Blake2b512, Digest}; use std::fmt; use crate::crypto::{PublicKey, StaticSecret}; @@ -23,10 +22,6 @@ impl Identity { } } - pub fn address(&self) -> String { - hex::encode(Blake2b512::digest(self.public_key())) - } - pub fn public_key(&self) -> PublicKey { PublicKey::from(&self.secret) } diff --git a/conversations/src/inbox/inbox.rs b/conversations/src/inbox/inbox.rs index f03ff17..b1c0848 100644 --- a/conversations/src/inbox/inbox.rs +++ b/conversations/src/inbox/inbox.rs @@ -187,7 +187,7 @@ impl Inbox { ); // TODO: Decrypt Content - let frame = proto::InboxV1Frame::decode(bytes)?; + let frame = self.decrypt_frame(bytes)?; Ok((seed_key, frame)) } @@ -203,12 +203,9 @@ impl Inbox { Ok(handshake) } - fn decrypt_frame( - enc_payload: proto::InboxHandshakeV1, - ) -> Result { - let frame_bytes = enc_payload.payload; + fn decrypt_frame(&self, enc_frame_bytes: Bytes) -> Result { // TODO: decrypt payload - let frame = proto::InboxV1Frame::decode(frame_bytes)?; + let frame = proto::InboxV1Frame::decode(enc_frame_bytes)?; Ok(frame) }