Skip to content

Commit

Permalink
More formatting fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Mircea <mirceapetrebogdan@gmail.com>
  • Loading branch information
bobozaur committed Sep 20, 2023
1 parent dff7c0b commit 5a38524
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 49 deletions.
2 changes: 1 addition & 1 deletion aries_vcx/src/common/signing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub async fn unpack_message_to_string(
// .await
// .unwrap();
// signed_response.connection_sig.signer =
// String::from("AAAAAAAAAAAAAAAAXkaJdrQejfztN4XqdsiV4ct3LXKL");
// String::from("AAAAAAAAAAAAAAAAXkaJdrQejfztN4XqdsiV4ct3LXKL");
// decode_signed_connection_response(&profile.inject_wallet(), signed_response, &trustee_key)
// .await
// .unwrap_err();
Expand Down
4 changes: 2 additions & 2 deletions aries_vcx/src/handlers/connection/mediated_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -290,8 +290,8 @@ impl MediatedConnection {

pub fn bootstrap_did_doc(&self) -> Option<AriesDidDoc> {
match &self.connection_sm {
SmConnection::Inviter(_sm_inviter) => None, /* TODO: Inviter can remember bootstrap
* agent too, but we don't need it */
SmConnection::Inviter(_sm_inviter) => None, /* TODO: Inviter can remember bootstrap */
// agent too, but we don't need it
SmConnection::Invitee(sm_invitee) => sm_invitee.bootstrap_did_doc(),
}
}
Expand Down
52 changes: 26 additions & 26 deletions aries_vcx/src/handlers/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,34 +38,34 @@ macro_rules! get_attach_as_string {
($attachments:expr) => {{
let __attach = $attachments.get(0).as_ref().map(|a| &a.data.content);
let Some(messages::decorators::attachment::AttachmentType::Base64(encoded_attach)) =
__attach
else {
return Err(AriesVcxError::from_msg(
AriesVcxErrorKind::SerializationError,
format!(
"Attachment is not base 64 encoded JSON: {:?}",
$attachments.get(0)
),
));
};
__attach
else {
return Err(AriesVcxError::from_msg(
AriesVcxErrorKind::SerializationError,
format!(
"Attachment is not base 64 encoded JSON: {:?}",
$attachments.get(0)
),
));
};
let Ok(bytes) = base64::decode(encoded_attach) else {
return Err(AriesVcxError::from_msg(
AriesVcxErrorKind::SerializationError,
format!(
"Attachment is not base 64 encoded JSON: {:?}",
$attachments.get(0)
),
));
};
return Err(AriesVcxError::from_msg(
AriesVcxErrorKind::SerializationError,
format!(
"Attachment is not base 64 encoded JSON: {:?}",
$attachments.get(0)
),
));
};
let Ok(attach_string) = String::from_utf8(bytes) else {
return Err(AriesVcxError::from_msg(
AriesVcxErrorKind::SerializationError,
format!(
"Attachment is not base 64 encoded JSON: {:?}",
$attachments.get(0)
),
));
};
return Err(AriesVcxError::from_msg(
AriesVcxErrorKind::SerializationError,
format!(
"Attachment is not base 64 encoded JSON: {:?}",
$attachments.get(0)
),
));
};

attach_string
}};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ impl SmConnectionInvitee {

// pub async fn invitee_sm() -> SmConnectionInvitee {
// let pairwise_info =
// PairwiseInfo::create(&mock_profile().inject_wallet()).await.unwrap();
// PairwiseInfo::create(&mock_profile().inject_wallet()).await.unwrap();
// SmConnectionInvitee::new(&source_id(), pairwise_info, _did_doc_inlined_recipient_keys())
// }

Expand Down Expand Up @@ -874,7 +874,7 @@ impl SmConnectionInvitee {

// // Problem Report
// did_exchange_sm =
// did_exchange_sm.handle_problem_report(_problem_report()).unwrap();
// did_exchange_sm.handle_problem_report(_problem_report()).unwrap();
// assert_match!(InviteeFullState::Completed(_), did_exchange_sm.state); }
// }

Expand All @@ -895,7 +895,7 @@ impl SmConnectionInvitee {
// "key_1".to_string() => A2AMessage::ConnectionRequest(_request()),
// "key_2".to_string() =>
// A2AMessage::ConnectionResponse(_signed_response()), "key_3".to_string()
// => A2AMessage::ConnectionProblemReport(_problem_report()),
// => A2AMessage::ConnectionProblemReport(_problem_report()),
// "key_4".to_string() => A2AMessage::Ping(_ping()), "key_5".to_string() =>
// A2AMessage::Ack(_ack()) );

Expand All @@ -918,7 +918,7 @@ impl SmConnectionInvitee {
// );

// let (uid, message) =
// connection.find_message_to_update_state(messages).unwrap();
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_3", uid); assert_match!(A2AMessage::ConnectionResponse(_),
// message); }

Expand All @@ -931,8 +931,8 @@ impl SmConnectionInvitee {
// A2AMessage::ConnectionProblemReport(_problem_report()) );

// let (uid, message) =
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_3", uid);
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_3", uid);
// assert_match!(A2AMessage::ConnectionProblemReport(_), message); }

// // No messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ impl SmConnectionInviter {

// pub async fn inviter_sm() -> SmConnectionInviter {
// let pairwise_info =
// PairwiseInfo::create(&mock_profile().inject_wallet()).await.unwrap();
// PairwiseInfo::create(&mock_profile().inject_wallet()).await.unwrap();
// SmConnectionInviter::new(&source_id(), pairwise_info) }

// impl SmConnectionInviter {
Expand Down Expand Up @@ -599,7 +599,7 @@ impl SmConnectionInviter {
// .unwrap();
// assert_match!(InviterFullState::Initial(_), did_exchange_sm.state);
// did_exchange_sm =
// did_exchange_sm.handle_problem_report(_problem_report()).unwrap();
// did_exchange_sm.handle_problem_report(_problem_report()).unwrap();
// assert_match!(InviterFullState::Initial(_), did_exchange_sm.state); }

// #[tokio::test]
Expand All @@ -626,12 +626,12 @@ impl SmConnectionInviter {
// .await
// .unwrap();
// did_exchange_sm =
// did_exchange_sm.handle_send_response(_send_message()).await.unwrap();
// did_exchange_sm.handle_send_response(_send_message()).await.unwrap();
// assert_match!(InviterFullState::Responded(_), did_exchange_sm.state); }

// #[tokio::test]
// async fn
// test_did_exchange_handle_invalid_exchange_request_message_from_invited_state() {
// test_did_exchange_handle_invalid_exchange_request_message_from_invited_state() {
// let _setup = SetupIndyMocks::init();

// let mut did_exchange_sm = inviter_sm().await.to_inviter_invited_state();
Expand Down Expand Up @@ -777,7 +777,7 @@ impl SmConnectionInviter {

// // Problem Report
// did_exchange_sm =
// did_exchange_sm.handle_problem_report(_problem_report()).unwrap();
// did_exchange_sm.handle_problem_report(_problem_report()).unwrap();
// assert_match!(InviterFullState::Completed(_), did_exchange_sm.state); }
// }

Expand All @@ -798,7 +798,7 @@ impl SmConnectionInviter {
// "key_1".to_string() => A2AMessage::ConnectionRequest(_request()),
// "key_2".to_string() =>
// A2AMessage::ConnectionResponse(_signed_response()), "key_3".to_string()
// => A2AMessage::ConnectionProblemReport(_problem_report()),
// => A2AMessage::ConnectionProblemReport(_problem_report()),
// "key_4".to_string() => A2AMessage::Ping(_ping()), "key_5".to_string() =>
// A2AMessage::Ack(_ack()) );

Expand All @@ -821,7 +821,7 @@ impl SmConnectionInviter {
// );

// let (uid, message) =
// connection.find_message_to_update_state(messages).unwrap();
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_2", uid); assert_match!(A2AMessage::ConnectionRequest(_),
// message); }

Expand All @@ -834,8 +834,8 @@ impl SmConnectionInviter {
// A2AMessage::ConnectionProblemReport(_problem_report()) );

// let (uid, message) =
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_3", uid);
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_3", uid);
// assert_match!(A2AMessage::ConnectionProblemReport(_), message); }

// // No messages
Expand Down Expand Up @@ -864,7 +864,7 @@ impl SmConnectionInviter {
// );

// let (uid, message) =
// connection.find_message_to_update_state(messages).unwrap();
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_1", uid); assert_match!(A2AMessage::Ping(_), message);
// }

Expand All @@ -877,7 +877,7 @@ impl SmConnectionInviter {
// );

// let (uid, message) =
// connection.find_message_to_update_state(messages).unwrap();
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_2", uid); assert_match!(A2AMessage::Ack(_), message);
// }

Expand All @@ -889,8 +889,8 @@ impl SmConnectionInviter {
// A2AMessage::ConnectionProblemReport(_problem_report()) );

// let (uid, message) =
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_2", uid);
// connection.find_message_to_update_state(messages).unwrap();
// assert_eq!("key_2", uid);
// assert_match!(A2AMessage::ConnectionProblemReport(_), message); }

// // No messages
Expand Down
2 changes: 1 addition & 1 deletion libvdrtools/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
merge_imports = true
imports_granularity = "Crate"

0 comments on commit 5a38524

Please sign in to comment.