Skip to content

Commit

Permalink
Resolve errors in identity.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
zombieobject committed Mar 20, 2024
1 parent 66e94de commit 82bb5b1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
7 changes: 3 additions & 4 deletions xmtp_mls/src/identity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,14 @@ use openmls::{
prelude::{
Capabilities, Credential as OpenMlsCredential, CredentialType, CredentialWithKey,
CryptoConfig, Extension, ExtensionType, Extensions, KeyPackage, KeyPackageNewError,
Lifetime,
Lifetime, tls_codec::Serialize,
},
versions::ProtocolVersion,
};
use openmls_basic_credential::SignatureKeyPair;
use openmls_traits::{types::CryptoError, OpenMlsProvider};
use prost::Message;
use thiserror::Error;
use openmls::prelude::tls_codec::Serialize;
use xmtp_cryptography::signature::SignatureError;
use xmtp_proto::{
api_client::XmtpMlsClient, xmtp::mls::message_contents::MlsCredential as CredentialProto,
Expand Down Expand Up @@ -99,7 +98,7 @@ impl Identity {
Credential::create_from_legacy(&signature_keys, legacy_signed_private_key)?;
let credential_proto: CredentialProto = credential.into();
let mls_credential =
OpenMlsCredential::new(credential_proto.encode_to_vec(), CredentialType::Basic)?;
OpenMlsCredential::new(CredentialType::Basic, credential_proto.encode_to_vec());
info!("Successfully created identity from legacy key");
Ok(Self {
account_address,
Expand Down Expand Up @@ -137,7 +136,7 @@ impl Identity {
)?
.into();
let credential =
OpenMlsCredential::new(credential_proto.encode_to_vec(), CredentialType::Basic)?;
OpenMlsCredential::new(CredentialType::Basic, credential_proto.encode_to_vec());
self.set_credential(credential)?;
}

Expand Down
9 changes: 7 additions & 2 deletions xmtp_mls/src/verified_key_package.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
use openmls::prelude::{KeyPackage, KeyPackageIn, KeyPackageVerifyError};
use openmls::prelude::{
KeyPackage, KeyPackageIn, KeyPackageVerifyError,
tls_codec::{
Deserialize, Error as TlsSerializationError
},
};

use openmls_rust_crypto::RustCrypto;
use thiserror::Error;
use openmls::prelude::tls_codec::{Deserialize, Error as TlsSerializationError};

use crate::{
configuration::MLS_PROTOCOL_VERSION,
Expand Down

0 comments on commit 82bb5b1

Please sign in to comment.