Skip to content

Commit

Permalink
Eradicate mediated connection from issuance and presentation integrat…
Browse files Browse the repository at this point in the history
…ion tests, part 2 (#974)

Integration test refactoring

* Remove agency+mysql tests, useless modules, group scenarios
* Eliminate MediatedConnection from integration tests
* Refactor connection establishing, remove redundant connection tests, deduplicate
* Remove agency_client from Alice and Faber and prune, remove create_faber_trustee
* Remove create_schema as Faber method
* Remove Faber's endpoint service creation
* Remove schema from Faber, init_issuer_config
* Remove alice, use extracted faber endpoint creation in connection tests
* Rename Faber to TestAgent
* Remove TestTransport

---------

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
Signed-off-by: Bogdan Mircea <mirceapetrebogdan@gmail.com>
  • Loading branch information
mirgee authored and bobozaur committed Sep 14, 2023
1 parent 0366e31 commit b152d04
Show file tree
Hide file tree
Showing 15 changed files with 2,865 additions and 3,890 deletions.
9 changes: 9 additions & 0 deletions aries_vcx/src/handlers/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,15 @@ pub enum AnyInvitation {
Oob(OobInvitation),
}

impl AnyInvitation {
pub fn id(&self) -> &str {
match self {
AnyInvitation::Con(invitation) => &invitation.id(),
AnyInvitation::Oob(invitation) => &invitation.id,
}
}
}

// todo: this is shared by multiple protocols to express different things - needs to be split
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)]
pub enum Status {
Expand Down
14 changes: 14 additions & 0 deletions aries_vcx/src/protocols/connection/generic/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ use crate::{
trait_bounds::{TheirDidDoc, ThreadId},
},
transport::Transport,
utils::encryption_envelope::EncryptionEnvelope,
};

use super::{trait_bounds::BootstrapDidDoc, wrap_and_send_msg};
Expand Down Expand Up @@ -173,6 +174,19 @@ impl GenericConnection {
}
}

pub async fn encrypt_message(
&self,
wallet: &Arc<dyn BaseWallet>,
message: &AriesMessage,
) -> VcxResult<EncryptionEnvelope> {
let sender_verkey = &self.pairwise_info().pw_vk;
let did_doc = self.their_did_doc().ok_or(AriesVcxError::from_msg(
AriesVcxErrorKind::NotReady,
"No DidDoc present",
))?;
EncryptionEnvelope::create(wallet, message, Some(sender_verkey), did_doc).await
}

pub async fn send_message<T>(
&self,
wallet: &Arc<dyn BaseWallet>,
Expand Down
Loading

0 comments on commit b152d04

Please sign in to comment.