Skip to content

Commit

Permalink
Rename SetupLibraryAgencyV2 to SetupPool (#568)
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
  • Loading branch information
mirgee authored Sep 16, 2022
1 parent 2ddb75c commit 7b78b5b
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 43 deletions.
14 changes: 7 additions & 7 deletions aries_vcx/src/utils/devsetup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ pub struct SetupInstitutionWallet {
pub wallet_handle: WalletHandle,
}

pub struct SetupLibraryAgencyV2 {
pub struct SetupPool {
pub pool_handle: PoolHandle
}

Expand Down Expand Up @@ -317,9 +317,9 @@ impl Drop for SetupInstitutionWallet {
}
}

impl SetupLibraryAgencyV2 {
pub async fn init() -> SetupLibraryAgencyV2 {
debug!("SetupLibraryAgencyV2 init >> going to setup agency environment");
impl SetupPool {
pub async fn init() -> SetupPool {
debug!("SetupPool init >> going to setup agency environment");
init_test_logging();

settings::set_config_value(
Expand All @@ -330,14 +330,14 @@ impl SetupLibraryAgencyV2 {
)
.unwrap();
let pool_handle = open_test_pool().await;
debug!("SetupLibraryAgencyV2 init >> completed");
SetupLibraryAgencyV2 {
debug!("SetupPool init >> completed");
SetupPool {
pool_handle
}
}
}

impl Drop for SetupLibraryAgencyV2 {
impl Drop for SetupPool {
fn drop(&mut self) {
futures::executor::block_on(delete_test_pool(self.pool_handle));
reset_global_state();
Expand Down
14 changes: 7 additions & 7 deletions aries_vcx/tests/test_agency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ mod integration_tests {
use aries_vcx::libindy::wallet::open_wallet;
use aries_vcx::messages::a2a::A2AMessage;
use aries_vcx::messages::ack::test_utils::_ack;
use aries_vcx::utils::devsetup::SetupLibraryAgencyV2;
use aries_vcx::utils::devsetup::SetupPool;

use crate::utils::devsetup_agent::test_utils::{Alice, Faber};
use crate::utils::scenarios::test_utils::create_connected_connections;

#[tokio::test]
#[cfg(feature = "agency_v2")]
async fn test_send_and_download_messages() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -121,7 +121,7 @@ mod integration_tests {
#[tokio::test]
#[cfg(feature = "agency_v2")]
async fn test_connection_send_works() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut faber = Faber::setup(setup.pool_handle).await;
let mut alice = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -236,7 +236,7 @@ mod integration_tests {
#[cfg(feature = "agency_v2")]
#[tokio::test]
async fn test_download_messages() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer1 = Alice::setup(setup.pool_handle).await;
let mut consumer2 = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -292,7 +292,7 @@ mod integration_tests {
#[cfg(feature = "agency_v2")]
#[tokio::test]
async fn test_update_agency_messages() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut faber = Faber::setup(setup.pool_handle).await;
let mut alice = Alice::setup(setup.pool_handle).await;
let (alice_to_faber, faber_to_alice) = create_connected_connections(&mut alice, &mut faber).await;
Expand Down Expand Up @@ -366,7 +366,7 @@ mod integration_tests {
#[cfg(feature = "agency_v2")]
#[tokio::test]
async fn test_download_messages_from_multiple_connections() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer1 = Alice::setup(setup.pool_handle).await;
let mut consumer2 = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -400,7 +400,7 @@ mod integration_tests {
#[cfg(feature = "agency_v2")]
#[tokio::test]
async fn test_update_agent_webhook() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let wallet_config = WalletConfig {
wallet_name: format!("wallet_{}", uuid::Uuid::new_v4().to_string()),
wallet_key: settings::DEFAULT_WALLET_KEY.into(),
Expand Down
12 changes: 6 additions & 6 deletions aries_vcx/tests/test_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mod integration_tests {

#[tokio::test]
async fn test_establish_connection_via_public_invite() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand All @@ -53,7 +53,7 @@ mod integration_tests {

#[tokio::test]
async fn test_oob_connection_bootstrap() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -139,7 +139,7 @@ mod integration_tests {

#[tokio::test]
async fn test_oob_connection_reuse() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -172,7 +172,7 @@ mod integration_tests {

#[tokio::test]
async fn test_oob_connection_handshake_reuse() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -261,7 +261,7 @@ mod integration_tests {

#[tokio::test]
pub async fn test_two_enterprise_connections() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer1 = Alice::setup(setup.pool_handle).await;

Expand All @@ -271,7 +271,7 @@ mod integration_tests {

#[tokio::test]
async fn aries_demo_handle_connection_related_messages() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;

let mut faber = Faber::setup(setup.pool_handle).await;
let mut alice = Alice::setup(setup.pool_handle).await;
Expand Down
28 changes: 14 additions & 14 deletions aries_vcx/tests/test_creds_proofs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ mod tests {

#[tokio::test]
async fn test_proof_should_be_validated() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -403,7 +403,7 @@ mod tests {

#[tokio::test]
async fn test_proof_with_predicates_should_be_validated() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -462,7 +462,7 @@ mod tests {

#[tokio::test]
async fn test_it_should_fail_to_select_credentials_for_predicate() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -502,7 +502,7 @@ mod tests {

#[tokio::test]
async fn test_double_issuance_separate_issuer_and_consumers() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer1 = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -585,7 +585,7 @@ mod tests {

#[tokio::test]
async fn test_double_issuance_separate_issuer() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -637,7 +637,7 @@ mod tests {

#[tokio::test]
async fn test_double_issuance_issuer_is_verifier() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
let (consumer_to_institution, institution_to_consumer) =
Expand Down Expand Up @@ -710,7 +710,7 @@ mod tests {

#[tokio::test]
async fn test_real_proof() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -828,7 +828,7 @@ mod tests {

#[tokio::test]
async fn test_two_creds_one_rev_reg() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -906,7 +906,7 @@ mod tests {

#[tokio::test]
pub async fn test_credential_exchange_via_proposal() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand All @@ -932,7 +932,7 @@ mod tests {

#[tokio::test]
pub async fn test_credential_exchange_via_proposal_failed() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -968,7 +968,7 @@ mod tests {

#[tokio::test]
pub async fn test_credential_exchange_via_proposal_with_negotiation() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -1025,7 +1025,7 @@ mod tests {

#[tokio::test]
pub async fn test_presentation_via_proposal() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -1064,7 +1064,7 @@ mod tests {

#[tokio::test]
pub async fn test_presentation_via_proposal_with_rejection() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -1093,7 +1093,7 @@ mod tests {

#[tokio::test]
pub async fn test_presentation_via_proposal_with_negotiation() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down
18 changes: 9 additions & 9 deletions aries_vcx/tests/test_creds_proofs_revocations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ mod integration_tests {
#[cfg(feature = "agency_pool_tests")]
#[tokio::test]
async fn test_basic_revocation() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -94,7 +94,7 @@ mod integration_tests {
#[cfg(feature = "agency_pool_tests")]
#[tokio::test]
async fn test_local_revocation() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -161,7 +161,7 @@ mod integration_tests {
#[cfg(feature = "agency_pool_tests")]
#[tokio::test]
async fn test_batch_revocation() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer1 = Alice::setup(setup.pool_handle).await;
let mut consumer2 = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -360,7 +360,7 @@ mod integration_tests {
#[cfg(feature = "agency_pool_tests")]
#[tokio::test]
async fn test_revoked_credential_might_still_work() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut institution = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;

Expand Down Expand Up @@ -445,7 +445,7 @@ mod integration_tests {
#[tokio::test]
#[cfg(feature = "agency_pool_tests")]
async fn test_two_creds_one_rev_reg_revoke_first() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -526,7 +526,7 @@ mod integration_tests {
#[tokio::test]
#[cfg(feature = "agency_pool_tests")]
async fn test_two_creds_one_rev_reg_revoke_second() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -607,7 +607,7 @@ mod integration_tests {
#[tokio::test]
#[cfg(feature = "agency_pool_tests")]
async fn test_two_creds_two_rev_reg_id() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -687,7 +687,7 @@ mod integration_tests {
#[tokio::test]
#[cfg(feature = "agency_pool_tests")]
async fn test_two_creds_two_rev_reg_id_revoke_first() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
Expand Down Expand Up @@ -769,7 +769,7 @@ mod integration_tests {
#[tokio::test]
#[cfg(feature = "agency_pool_tests")]
async fn test_two_creds_two_rev_reg_id_revoke_second() {
let setup = SetupLibraryAgencyV2::init().await;
let setup = SetupPool::init().await;
let mut issuer = Faber::setup(setup.pool_handle).await;
let mut verifier = Faber::setup(setup.pool_handle).await;
let mut consumer = Alice::setup(setup.pool_handle).await;
Expand Down

0 comments on commit 7b78b5b

Please sign in to comment.