From 19f16fd7a0e2dadbf3b995a3602beb619687382a Mon Sep 17 00:00:00 2001 From: Swapnil Tripathi Date: Wed, 18 Oct 2023 06:49:30 +0530 Subject: [PATCH] fix formatting Signed-off-by: Swapnil Tripathi --- .../core/src/handlers/connection.rs | 19 +++++++------------ uniffi_aries_vcx/core/src/handlers/holder.rs | 3 +-- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/uniffi_aries_vcx/core/src/handlers/connection.rs b/uniffi_aries_vcx/core/src/handlers/connection.rs index d34738a8b6..4cc8b9f6f0 100644 --- a/uniffi_aries_vcx/core/src/handlers/connection.rs +++ b/uniffi_aries_vcx/core/src/handlers/connection.rs @@ -1,22 +1,19 @@ -use std::sync::{Arc, Mutex}; - +use crate::{ + core::{http_client::HttpClient, profile::ProfileHolder}, + errors::error::VcxUniFFIResult, + runtime::block_on, +}; use aries_vcx::{ core::profile::profile::Profile, 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, @@ -247,11 +244,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, }