diff --git a/xmtp_id/src/associations/builder.rs b/xmtp_id/src/associations/builder.rs index 72ff0c9cc..90d63a9b3 100644 --- a/xmtp_id/src/associations/builder.rs +++ b/xmtp_id/src/associations/builder.rs @@ -247,7 +247,7 @@ fn build_action( .get(&SignatureField::InitialAddress) .ok_or(SignatureRequestError::MissingSigner)?; let initial_address_signature = signatures - .get(&signer_identity) + .get(signer_identity) .cloned() .ok_or(SignatureRequestError::MissingSigner)?; @@ -268,12 +268,12 @@ fn build_action( .ok_or(SignatureRequestError::MissingSigner)?; let existing_member_signature = signatures - .get(&existing_member_signer_identity) + .get(existing_member_signer_identity) .cloned() .ok_or(SignatureRequestError::MissingSigner)?; let new_member_signature = signatures - .get(&new_member_signer_identity) + .get(new_member_signer_identity) .cloned() .ok_or(SignatureRequestError::MissingSigner)?; @@ -289,7 +289,7 @@ fn build_action( .get(&SignatureField::RecoveryAddress) .ok_or(SignatureRequestError::MissingSigner)?; let recovery_address_signature = signatures - .get(&signer_identity) + .get(signer_identity) .cloned() .ok_or(SignatureRequestError::MissingSigner)?; @@ -305,7 +305,7 @@ fn build_action( .ok_or(SignatureRequestError::MissingSigner)?; let recovery_address_signature = signatures - .get(&signer_identity) + .get(signer_identity) .cloned() .ok_or(SignatureRequestError::MissingSigner)?; diff --git a/xmtp_id/src/associations/mod.rs b/xmtp_id/src/associations/mod.rs index b1b0af985..2f2680761 100644 --- a/xmtp_id/src/associations/mod.rs +++ b/xmtp_id/src/associations/mod.rs @@ -3,7 +3,6 @@ pub mod builder; mod hashes; mod member; mod signature; -mod signer; mod state; #[cfg(test)] mod test_utils; diff --git a/xmtp_id/src/associations/signer.rs b/xmtp_id/src/associations/signer.rs deleted file mode 100644 index b606bc5fc..000000000 --- a/xmtp_id/src/associations/signer.rs +++ /dev/null @@ -1,35 +0,0 @@ -use thiserror::Error; - -use super::{MemberIdentifier, Signature, SignatureKind}; - -#[derive(Error, Debug)] -pub enum SignerError { - #[error("Signature error {0}")] - Generic(String), -} - -#[async_trait::async_trait] -pub trait Signer: SignerClone { - fn signer_identity(&self) -> MemberIdentifier; - fn signature_kind(&self) -> SignatureKind; - fn sign(&self, text: &str) -> Result, SignerError>; -} - -pub trait SignerClone { - fn clone_box(&self) -> Box; -} - -impl SignerClone for T -where - T: 'static + Signer + Clone, -{ - fn clone_box(&self) -> Box { - Box::new(self.clone()) - } -} - -impl Clone for Box { - fn clone(&self) -> Box { - self.clone_box() - } -} diff --git a/xmtp_id/src/associations/test_utils.rs b/xmtp_id/src/associations/test_utils.rs index d02490397..3fd06ab1f 100644 --- a/xmtp_id/src/associations/test_utils.rs +++ b/xmtp_id/src/associations/test_utils.rs @@ -1,12 +1,6 @@ use rand::{distributions::Alphanumeric, Rng}; -use super::{ - // signer::{Signer, SignerClone, SignerError}, - MemberIdentifier, - Signature, - SignatureError, - SignatureKind, -}; +use super::{MemberIdentifier, Signature, SignatureError, SignatureKind}; pub fn rand_string() -> String { let v: String = rand::thread_rng() @@ -72,36 +66,3 @@ impl Signature for MockSignature { sig.as_bytes().to_vec() } } - -// #[derive(Clone)] -// pub struct MockSigner { -// identity: MemberIdentifier, -// signature_kind: SignatureKind, -// } - -// impl Signer for MockSigner { -// fn signature_kind(&self) -> SignatureKind { -// self.signature_kind.clone() -// } -// fn signer_identity(&self) -> MemberIdentifier { -// self.identity.clone() -// } - -// fn sign(&self, text: &str) -> Result, SignerError> { -// Ok(MockSignature::new_boxed( -// true, -// self.signer_identity(), -// self.signature_kind(), -// Some(text.to_string()), -// )) -// } -// } - -// impl MockSigner { -// pub fn new_boxed(identity: MemberIdentifier, signature_kind: SignatureKind) -> Box { -// Box::new(Self { -// identity, -// signature_kind, -// }) -// } -// }