Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
Signed-off-by: Swapnil Tripathi <[email protected]>
  • Loading branch information
swaptr committed Oct 19, 2023
1 parent ba00782 commit a7d56b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
19 changes: 7 additions & 12 deletions uniffi_aries_vcx/core/src/handlers/connection.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -246,11 +243,9 @@ impl Connection {
) -> VcxUniFFIResult<()> {
let message = serde_json::from_str(&message)?;
let mut handler = self.handler.lock()?;
let connection: VcxConnection<Inviter, Completed> =
VcxConnection::try_from(handler.clone())?;

block_on(async {
connection
handler
.send_message(profile_holder.inner.wallet(), &message, &HttpClient)
.await?;
Ok(())
Expand Down
3 changes: 1 addition & 2 deletions uniffi_aries_vcx/core/src/handlers/holder.rs
Original file line number Diff line number Diff line change
@@ -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<VcxHolder>,
}
Expand Down

0 comments on commit a7d56b6

Please sign in to comment.