Skip to content

Commit

Permalink
chore: cargo clippy fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Naian <[email protected]>
  • Loading branch information
nain-F49FF806 committed Oct 12, 2023
1 parent 8bb431e commit 625f499
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 31 deletions.
5 changes: 3 additions & 2 deletions mediator/src/agent/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl<T: BaseWallet + 'static, P: MediatorPersistence> Agent<T, P> {
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",
Expand Down Expand Up @@ -246,11 +246,12 @@ impl<T: BaseWallet + 'static, P: MediatorPersistence> Agent<T, P> {
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;
Expand Down
9 changes: 3 additions & 6 deletions mediator/src/routes/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use xum_test_server::{
mediator_coord_structs::{MediateGrantData, MediatorCoordMsgEnum},
PickupMsgEnum,
},
routes::pickup::handle_pickup,
storage::MediatorPersistence,
};

Expand Down Expand Up @@ -95,8 +94,8 @@ pub async fn handle_mediation_coord(
}

pub async fn handle_pickup_protocol(
agent: ArcAgent<impl BaseWallet + 'static, impl MediatorPersistence>,
pickup_msg: PickupMsgEnum,
_agent: ArcAgent<impl BaseWallet + 'static, impl MediatorPersistence>,
_pickup_msg: PickupMsgEnum,
) -> Result<EncryptionEnvelope, String> {
todo!()
}
Expand Down Expand Up @@ -140,9 +139,7 @@ pub async fn handle_aries<T: BaseWallet + 'static, P: MediatorPersistence>(
.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?;
Expand Down
26 changes: 3 additions & 23 deletions mediator/tests/mediator-coord.rs
Original file line number Diff line number Diff line change
@@ -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::{
Expand All @@ -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,
};
Expand Down

0 comments on commit 625f499

Please sign in to comment.