diff --git a/agents/rust/aries-vcx-agent/src/agent/init.rs b/agents/rust/aries-vcx-agent/src/agent/init.rs index 2a9d7e1198..11277791fb 100644 --- a/agents/rust/aries-vcx-agent/src/agent/init.rs +++ b/agents/rust/aries-vcx-agent/src/agent/init.rs @@ -1,17 +1,21 @@ use std::sync::Arc; -use aries_vcx::common::ledger::service_didsov::{DidSovServiceType, EndpointDidSov}; -use aries_vcx::common::ledger::transactions::{add_new_did, write_endpoint}; -use aries_vcx::global::settings::DEFAULT_LINK_SECRET_ALIAS; +use aries_vcx::{ + common::ledger::{ + service_didsov::{DidSovServiceType, EndpointDidSov}, + transactions::{add_new_did, write_endpoint}, + }, + global::settings::DEFAULT_LINK_SECRET_ALIAS, +}; use aries_vcx_core::{ self, anoncreds::{base_anoncreds::BaseAnonCreds, credx_anoncreds::IndyCredxAnonCreds}, + ledger::indy_vdr_ledger::DefaultIndyLedgerRead, wallet::indy::{ wallet::{create_and_open_wallet, wallet_configure_issuer}, IndySdkWallet, WalletConfig, }, }; -use aries_vcx_core::ledger::indy_vdr_ledger::DefaultIndyLedgerRead; use did_peer::resolver::PeerDidResolver; use did_resolver_registry::ResolverRegistry; use did_resolver_sov::resolution::DidSovResolver; @@ -104,14 +108,23 @@ impl Agent { let endpoint = EndpointDidSov::create() .set_service_endpoint(init_config.service_endpoint.clone()) .set_types(Some(vec![DidSovServiceType::DidCommunication])); - write_endpoint(wallet.as_ref(), ledger_write.as_ref(), &public_did, &endpoint).await?; + write_endpoint( + wallet.as_ref(), + ledger_write.as_ref(), + &public_did, + &endpoint, + ) + .await?; let did_peer_resolver = PeerDidResolver::new(); let did_sov_resolver = DidSovResolver::new(ledger_read_2); let did_resolver_registry = Arc::new( ResolverRegistry::new() .register_resolver::("peer".into(), did_peer_resolver.into()) - .register_resolver::>("sov".into(), did_sov_resolver.into()), + .register_resolver::>( + "sov".into(), + did_sov_resolver.into(), + ), ); let connections = Arc::new(ServiceConnections::new( diff --git a/agents/rust/aries-vcx-agent/src/services/did_exchange.rs b/agents/rust/aries-vcx-agent/src/services/did_exchange.rs index 72ddfb3350..59304cbd70 100644 --- a/agents/rust/aries-vcx-agent/src/services/did_exchange.rs +++ b/agents/rust/aries-vcx-agent/src/services/did_exchange.rs @@ -9,14 +9,14 @@ use aries_vcx::{ }, protocols::did_exchange::{ resolve_key_from_invitation, - state_machine::{ - generic::{GenericDidExchange, ThinState}, - }, + state_machine::generic::{GenericDidExchange, ThinState}, }, transport::Transport, }; -use aries_vcx_core::{anoncreds::credx_anoncreds::IndyCredxAnonCreds, wallet::indy::IndySdkWallet}; -use aries_vcx_core::ledger::indy_vdr_ledger::DefaultIndyLedgerRead; +use aries_vcx_core::{ + anoncreds::credx_anoncreds::IndyCredxAnonCreds, ledger::indy_vdr_ledger::DefaultIndyLedgerRead, + wallet::indy::IndySdkWallet, +}; use did_resolver_registry::ResolverRegistry; use super::connection::ServiceEndpoint; @@ -62,8 +62,10 @@ impl ServiceDidExchange { self.wallet.as_ref(), format!("did:sov:{}", their_did).parse()?, format!("did:sov:{}", self.public_did).parse()?, - ).await?; - let request_id = request.clone() + ) + .await?; + let request_id = request + .clone() .decorators .thread .ok_or_else(|| { diff --git a/aries_vcx/tests/utils/scenarios/connection.rs b/aries_vcx/tests/utils/scenarios/connection.rs index 6d188e4c57..d0c77bb3dc 100644 --- a/aries_vcx/tests/utils/scenarios/connection.rs +++ b/aries_vcx/tests/utils/scenarios/connection.rs @@ -1,6 +1,9 @@ use aries_vcx::{ errors::error::VcxResult, - handlers::{out_of_band::sender::OutOfBandSender, util::AnyInvitation}, + handlers::{ + out_of_band::{receiver::oob_invitation_to_legacy_did_doc, sender::OutOfBandSender}, + util::AnyInvitation, + }, protocols::{ connection::{Connection, GenericConnection}, mediated_connection::pairwise_info::PairwiseInfo, @@ -27,7 +30,6 @@ use messages::{ }; use url::Url; use uuid::Uuid; -use aries_vcx::handlers::out_of_band::receiver::oob_invitation_to_legacy_did_doc; use crate::utils::test_agent::TestAgent; diff --git a/libvcx_core/src/api_vcx/api_handle/mediated_connection.rs b/libvcx_core/src/api_vcx/api_handle/mediated_connection.rs index 33f6220c45..685f1260f0 100644 --- a/libvcx_core/src/api_vcx/api_handle/mediated_connection.rs +++ b/libvcx_core/src/api_vcx/api_handle/mediated_connection.rs @@ -4,17 +4,19 @@ use aries_vcx::{ agency_client::{api::downloaded_message::DownloadedMessage, MessageStatusCode}, handlers::{mediated_connection::MediatedConnection, util::AnyInvitation}, messages::{ - AriesMessage, msg_fields::protocols::connection::{ invitation::{Invitation, InvitationContent}, request::Request, }, + AriesMessage, + }, + protocols::{ + connection::invitee::any_invitation_into_did_doc, + mediated_connection::pairwise_info::PairwiseInfo, }, - protocols::mediated_connection::pairwise_info::PairwiseInfo, }; use serde_json; use uuid::Uuid; -use aries_vcx::protocols::connection::invitee::any_invitation_into_did_doc; use crate::{ api_vcx::{ @@ -152,7 +154,8 @@ pub async fn create_connection(source_id: &str) -> LibvcxResult { pub async fn create_connection_with_invite(source_id: &str, details: &str) -> LibvcxResult { debug!("create connection {} with invite {}", source_id, details); if let Ok(invitation) = serde_json::from_str::(details) { - let ddo = any_invitation_into_did_doc(get_main_ledger_read()?.as_ref(), &invitation).await?; + let ddo = + any_invitation_into_did_doc(get_main_ledger_read()?.as_ref(), &invitation).await?; let connection = MediatedConnection::create_with_invite( source_id, get_main_wallet()?.as_ref(), diff --git a/libvcx_core/src/api_vcx/api_handle/out_of_band.rs b/libvcx_core/src/api_vcx/api_handle/out_of_band.rs index f2dbeeafe2..fd825c73b1 100644 --- a/libvcx_core/src/api_vcx/api_handle/out_of_band.rs +++ b/libvcx_core/src/api_vcx/api_handle/out_of_band.rs @@ -2,17 +2,19 @@ use std::collections::HashMap; use aries_vcx::{ handlers::{ - out_of_band::{receiver::OutOfBandReceiver, sender::OutOfBandSender}, + out_of_band::{ + receiver::{oob_invitation_to_legacy_did_doc, OutOfBandReceiver}, + sender::OutOfBandSender, + }, util::AnyInvitation, }, messages::{ - AriesMessage, msg_fields::protocols::out_of_band::{invitation::OobService, OobGoalCode}, msg_types::Protocol, + AriesMessage, }, + protocols::connection::invitee::any_invitation_into_did_doc, }; -use aries_vcx::handlers::out_of_band::receiver::oob_invitation_to_legacy_did_doc; -use aries_vcx::protocols::connection::invitee::any_invitation_into_did_doc; use crate::{ api_vcx::{ diff --git a/messages/src/msg_fields/protocols/did_exchange/complete.rs b/messages/src/msg_fields/protocols/did_exchange/complete.rs index adde547b16..100295ce7b 100644 --- a/messages/src/msg_fields/protocols/did_exchange/complete.rs +++ b/messages/src/msg_fields/protocols/did_exchange/complete.rs @@ -1,11 +1,11 @@ use serde::{Deserialize, Serialize}; use shared_vcx::misc::serde_ignored::SerdeIgnored as NoContent; +use typed_builder::TypedBuilder; use crate::{ decorators::{thread::Thread, timing::Timing}, msg_parts::MsgParts, }; -use typed_builder::TypedBuilder; pub type Complete = MsgParts; diff --git a/messages/src/msg_fields/protocols/did_exchange/problem_report.rs b/messages/src/msg_fields/protocols/did_exchange/problem_report.rs index c018e77d97..598cfba41a 100644 --- a/messages/src/msg_fields/protocols/did_exchange/problem_report.rs +++ b/messages/src/msg_fields/protocols/did_exchange/problem_report.rs @@ -1,10 +1,10 @@ use serde::{Deserialize, Serialize}; +use typed_builder::TypedBuilder; use crate::{ decorators::{localization::MsgLocalization, thread::Thread, timing::Timing}, msg_parts::MsgParts, }; -use typed_builder::TypedBuilder; pub type ProblemReport = MsgParts; diff --git a/messages/src/msg_fields/protocols/did_exchange/response.rs b/messages/src/msg_fields/protocols/did_exchange/response.rs index 2358ca892a..9d7c321799 100644 --- a/messages/src/msg_fields/protocols/did_exchange/response.rs +++ b/messages/src/msg_fields/protocols/did_exchange/response.rs @@ -1,10 +1,10 @@ use serde::{Deserialize, Serialize}; +use typed_builder::TypedBuilder; use crate::{ decorators::{attachment::Attachment, thread::Thread, timing::Timing}, msg_parts::MsgParts, }; -use typed_builder::TypedBuilder; pub type Response = MsgParts;