diff --git a/uniffi_aries_vcx/core/src/handlers/connection.rs b/uniffi_aries_vcx/core/src/handlers/connection.rs index 9aebf5ef6d..316f3e0196 100644 --- a/uniffi_aries_vcx/core/src/handlers/connection.rs +++ b/uniffi_aries_vcx/core/src/handlers/connection.rs @@ -1,21 +1,18 @@ -use std::sync::{Arc, Mutex}; - +use crate::{ + core::{http_client::HttpClient, profile::ProfileHolder}, + errors::error::VcxUniFFIResult, + runtime::block_on, +}; use aries_vcx::{ errors::error::{AriesVcxError, AriesVcxErrorKind}, protocols::connection::{ - initiation_type::Inviter, inviter::states::completed::Completed, pairwise_info::PairwiseInfo, Connection as VcxConnection, GenericConnection as VcxGenericConnection, ThinState, }, }; +use std::sync::{Arc, Mutex}; use url::Url; -use crate::{ - core::{http_client::HttpClient, profile::ProfileHolder}, - errors::error::VcxUniFFIResult, - runtime::block_on, -}; - /// Wraps [ThinState], as uniffi cannot process enums with un-named fields pub struct ConnectionState { pub role: ConnectionRole, @@ -246,11 +243,9 @@ impl Connection { ) -> VcxUniFFIResult<()> { let message = serde_json::from_str(&message)?; let mut handler = self.handler.lock()?; - let connection: VcxConnection = - VcxConnection::try_from(handler.clone())?; block_on(async { - connection + handler .send_message(profile_holder.inner.wallet(), &message, &HttpClient) .await?; Ok(()) diff --git a/uniffi_aries_vcx/core/src/handlers/holder.rs b/uniffi_aries_vcx/core/src/handlers/holder.rs index 04c19ee3ab..d4b02db5da 100644 --- a/uniffi_aries_vcx/core/src/handlers/holder.rs +++ b/uniffi_aries_vcx/core/src/handlers/holder.rs @@ -1,10 +1,9 @@ +use crate::{core::profile::ProfileHolder, errors::error::VcxUniFFIResult, runtime::block_on}; use aries_vcx::{ core::profile::profile::Profile, handlers::issuance::holder::Holder as VcxHolder, protocols::issuance::holder::state_machine::HolderState as VcxHolderState, }; use std::sync::{Arc, Mutex}; - -use crate::{core::profile::ProfileHolder, errors::error::VcxUniFFIResult, runtime::block_on}; pub struct Holder { handler: Mutex, }