diff --git a/mediator/src/agent/mod.rs b/mediator/src/agent/mod.rs index a57388ef38..2a40a4633b 100644 --- a/mediator/src/agent/mod.rs +++ b/mediator/src/agent/mod.rs @@ -149,7 +149,7 @@ impl Agent { aries_transport: &mut impl AriesTransport, ) -> Result<(), String> { let EncryptionEnvelope(packed_message) = - self.pack_didcomm(&message, &our_vk, their_diddoc).await?; + self.pack_didcomm(message, our_vk, their_diddoc).await?; let packed_json = serde_json::from_slice(&packed_message).map_err(string_from_std_error)?; info!( "Packed: {:?}, sending", @@ -246,11 +246,12 @@ impl Agent { Ok(()) } } + +#[cfg(test)] mod test { use aries_vcx::utils::encryption_envelope::EncryptionEnvelope; use log::info; use serde_json::Value; - use xum_test_server::routes::json; use super::AgentMaker; use crate::agent::utils::oob2did; diff --git a/mediator/src/routes/mod.rs b/mediator/src/routes/mod.rs index 2a3507310f..c574e285d9 100644 --- a/mediator/src/routes/mod.rs +++ b/mediator/src/routes/mod.rs @@ -19,7 +19,6 @@ use xum_test_server::{ mediator_coord_structs::{MediateGrantData, MediatorCoordMsgEnum}, PickupMsgEnum, }, - routes::pickup::handle_pickup, storage::MediatorPersistence, }; @@ -95,8 +94,8 @@ pub async fn handle_mediation_coord( } pub async fn handle_pickup_protocol( - agent: ArcAgent, - pickup_msg: PickupMsgEnum, + _agent: ArcAgent, + _pickup_msg: PickupMsgEnum, ) -> Result { todo!() } @@ -140,9 +139,7 @@ pub async fn handle_aries( .expect("Sender key authenticated above, so it must be present.."); info!("Processing message for {:?}", account_name); match aries_message { - GeneralAriesMessage::AriesVCXSupported(aries_message) => match aries_message { - _ => Err(unhandled_aries(aries_message))?, - }, + GeneralAriesMessage::AriesVCXSupported(aries_message) => Err(unhandled_aries(aries_message))?, GeneralAriesMessage::XumCoord(coord_message) => { let coord_response = handle_mediation_coord(&agent, coord_message, &auth_pubkey).await?; diff --git a/mediator/tests/mediator-coord.rs b/mediator/tests/mediator-coord.rs index 71811ba66c..d564a4e0bc 100644 --- a/mediator/tests/mediator-coord.rs +++ b/mediator/tests/mediator-coord.rs @@ -1,21 +1,8 @@ mod common; use std::collections::VecDeque; -use aries_vcx::{ - handlers::util::AnyInvitation, - protocols::{ - connection::invitee::{ - states::{ - completed::Completed, initial::Initial as ClientInit, - requested::Requested as ClientRequestSent, - }, - InviteeConnection, - }, - mediated_connection::pairwise_info::PairwiseInfo, - }, - utils::{encryption_envelope::EncryptionEnvelope, mockdata::profile::mock_ledger::MockLedger}, -}; -use aries_vcx_core::wallet::{base_wallet::BaseWallet, indy::IndySdkWallet}; +use aries_vcx::protocols::connection::invitee::{states::completed::Completed, InviteeConnection}; +use aries_vcx_core::wallet::base_wallet::BaseWallet; use common::{prelude::*, test_setup::OneTimeInit}; use mediator::{ agent::{ @@ -24,15 +11,8 @@ use mediator::{ }, utils::{structs::VeriKey, GenericStringError}, }; -use messages::{ - msg_fields::protocols::{ - connection::{request::Request, response::Response, Connection}, - out_of_band::invitation::Invitation as OOBInvitation, - }, - AriesMessage, -}; +use messages::msg_fields::protocols::out_of_band::invitation::Invitation as OOBInvitation; use reqwest::header::ACCEPT; -use sqlx::MySqlPool; use xum_test_server::{ didcomm_types::mediator_coord_structs::MediatorCoordMsgEnum, storage::MediatorPersistence, };