From 3c9656219f0c8a335dd2382499978aeae399cbcc Mon Sep 17 00:00:00 2001 From: Patrik Stas Date: Tue, 6 Jun 2023 16:33:41 +0200 Subject: [PATCH] Sync up tests Signed-off-by: Patrik Stas --- aries_vcx/src/common/credentials/mod.rs | 16 +++-- .../primitives/revocation_registry_delta.rs | 13 ++-- .../common/proofs/prover/prover_internal.rs | 48 ++++++++++----- .../src/common/proofs/verifier/verifier.rs | 2 +- .../proofs/verifier/verifier_internal.rs | 17 ++++-- aries_vcx/tests/test_agency.rs | 16 +++-- aries_vcx/tests/test_creds_proofs.rs | 30 ++++++---- .../tests/test_creds_proofs_revocations.rs | 40 ++++++------- aries_vcx/tests/utils/devsetup_agent.rs | 6 +- aries_vcx/tests/utils/scenarios.rs | 60 +++++++++++++++---- 10 files changed, 164 insertions(+), 84 deletions(-) diff --git a/aries_vcx/src/common/credentials/mod.rs b/aries_vcx/src/common/credentials/mod.rs index 7c7ec325ab..edf75b341f 100644 --- a/aries_vcx/src/common/credentials/mod.rs +++ b/aries_vcx/src/common/credentials/mod.rs @@ -120,9 +120,11 @@ mod integration_tests { let tails_file = res.10; let rev_reg = res.11; - assert!(!is_cred_revoked(&setup.profile, &rev_reg_id, &cred_rev_id) - .await - .unwrap()); + assert!( + !is_cred_revoked(&setup.profile.inject_anoncreds_ledger_read(), &rev_reg_id, &cred_rev_id) + .await + .unwrap() + ); let anoncreds = Arc::clone(&setup.profile).inject_anoncreds(); @@ -137,9 +139,11 @@ mod integration_tests { std::thread::sleep(std::time::Duration::from_millis(500)); - assert!(is_cred_revoked(&setup.profile, &rev_reg_id, &cred_rev_id) - .await - .unwrap()); + assert!( + is_cred_revoked(&setup.profile.inject_anoncreds_ledger_read(), &rev_reg_id, &cred_rev_id) + .await + .unwrap() + ); }) .await; } diff --git a/aries_vcx/src/common/primitives/revocation_registry_delta.rs b/aries_vcx/src/common/primitives/revocation_registry_delta.rs index 690a4f454c..2a92ecba07 100644 --- a/aries_vcx/src/common/primitives/revocation_registry_delta.rs +++ b/aries_vcx/src/common/primitives/revocation_registry_delta.rs @@ -71,11 +71,14 @@ pub mod integration_tests { let (_, _, _, _, rev_reg_id, _, _) = create_and_store_credential_def(&setup.profile, &setup.institution_did, attrs).await; - assert!( - RevocationRegistryDelta::create_from_ledger(&setup.profile, &rev_reg_id, None, None) - .await - .is_ok() - ); + assert!(RevocationRegistryDelta::create_from_ledger( + &setup.profile.inject_anoncreds_ledger_read(), + &rev_reg_id, + None, + None + ) + .await + .is_ok()); }) .await; } diff --git a/aries_vcx/src/common/proofs/prover/prover_internal.rs b/aries_vcx/src/common/proofs/prover/prover_internal.rs index 4945b1203f..c221e7db3e 100644 --- a/aries_vcx/src/common/proofs/prover/prover_internal.rs +++ b/aries_vcx/src/common/proofs/prover/prover_internal.rs @@ -257,12 +257,16 @@ pub mod pool_tests { #[tokio::test] #[ignore] async fn test_pool_build_rev_states_json_empty() { - SetupProfile::run(|_setup| async move { + SetupProfile::run(|setup| async move { // empty vector assert_eq!( - build_rev_states_json(&_setup.profile, Vec::new().as_mut()) - .await - .unwrap(), + build_rev_states_json( + &setup.profile.inject_anoncreds_ledger_read(), + &setup.profile.inject_anoncreds(), + Vec::new().as_mut() + ) + .await + .unwrap(), "{}".to_string() ); @@ -280,9 +284,13 @@ pub mod pool_tests { revealed: None, }; assert_eq!( - build_rev_states_json(&_setup.profile, vec![cred1].as_mut()) - .await - .unwrap(), + build_rev_states_json( + &setup.profile.inject_anoncreds_ledger_read(), + &setup.profile.inject_anoncreds(), + vec![cred1].as_mut() + ) + .await + .unwrap(), "{}".to_string() ); }) @@ -354,7 +362,9 @@ pub mod unit_tests { }; let creds = vec![cred1, cred2]; - let credential_def = build_cred_defs_json_prover(&mock_profile(), &creds).await.unwrap(); + let credential_def = build_cred_defs_json_prover(&mock_profile().inject_anoncreds_ledger_read(), &creds) + .await + .unwrap(); assert!(credential_def.len() > 0); assert!(credential_def.contains(r#""id":"V4SGRU86Z58d6TV7PBUe6f:3:CL:47:tag1","schemaId":"47""#)); } @@ -375,7 +385,7 @@ pub mod unit_tests { timestamp: None, revealed: None, }]; - let err_kind = build_cred_defs_json_prover(&profile, &credential_ids) + let err_kind = build_cred_defs_json_prover(&profile.inject_anoncreds_ledger_read(), &credential_ids) .await .unwrap_err() .kind(); @@ -402,7 +412,7 @@ pub mod unit_tests { }]; assert_eq!( - build_schemas_json_prover(&profile, &credential_ids) + build_schemas_json_prover(&profile.inject_anoncreds_ledger_read(), &credential_ids) .await .unwrap_err() .kind(), @@ -417,7 +427,9 @@ pub mod unit_tests { let _setup = SetupMocks::init(); assert_eq!( - build_schemas_json_prover(&mock_profile(), &Vec::new()).await.unwrap(), + build_schemas_json_prover(&mock_profile().inject_anoncreds_ledger_read(), &Vec::new()) + .await + .unwrap(), "{}".to_string() ); @@ -447,7 +459,9 @@ pub mod unit_tests { }; let creds = vec![cred1, cred2]; - let schemas = build_schemas_json_prover(&mock_profile(), &creds).await.unwrap(); + let schemas = build_schemas_json_prover(&mock_profile().inject_anoncreds_ledger_read(), &creds) + .await + .unwrap(); assert!(schemas.len() > 0); assert!(schemas.contains(r#""id":"2hoqvcwupRTUNkXn6ArYzs:2:test-licence:4.4.4","name":"test-licence""#)); } @@ -710,9 +724,13 @@ pub mod unit_tests { revealed: None, }; let mut cred_info = vec![cred1]; - let states = build_rev_states_json(&mock_profile(), cred_info.as_mut()) - .await - .unwrap(); + let states = build_rev_states_json( + &mock_profile().inject_anoncreds_ledger_read(), + &mock_profile().inject_anoncreds(), + cred_info.as_mut(), + ) + .await + .unwrap(); let rev_state_json: Value = serde_json::from_str(REV_STATE_JSON).unwrap(); let expected = json!({REV_REG_ID: {"1": rev_state_json}}).to_string(); assert_eq!(states, expected); diff --git a/aries_vcx/src/common/proofs/verifier/verifier.rs b/aries_vcx/src/common/proofs/verifier/verifier.rs index 5ade651bc0..371c4e0a88 100644 --- a/aries_vcx/src/common/proofs/verifier/verifier.rs +++ b/aries_vcx/src/common/proofs/verifier/verifier.rs @@ -118,7 +118,7 @@ pub mod unit_tests { assert_eq!( validate_indy_proof( - &setup.profile.inject_indy_ledger_read(), + &setup.profile.inject_anoncreds_ledger_read(), &setup.profile.inject_anoncreds(), &prover_proof_json, &proof_req_json diff --git a/aries_vcx/src/common/proofs/verifier/verifier_internal.rs b/aries_vcx/src/common/proofs/verifier/verifier_internal.rs index b79e7012e9..224ba0c0be 100644 --- a/aries_vcx/src/common/proofs/verifier/verifier_internal.rs +++ b/aries_vcx/src/common/proofs/verifier/verifier_internal.rs @@ -237,9 +237,10 @@ pub mod unit_tests { timestamp: None, }; let credentials = vec![cred1, cred2]; - let credential_json = build_cred_defs_json_verifier(&mock_profile(), &credentials) - .await - .unwrap(); + let credential_json = + build_cred_defs_json_verifier(&mock_profile().inject_anoncreds_ledger_read(), &credentials) + .await + .unwrap(); let json: Value = serde_json::from_str(CRED_DEF_JSON).unwrap(); let expected = json!({ CRED_DEF_ID: json }).to_string(); @@ -263,7 +264,7 @@ pub mod unit_tests { timestamp: None, }; let credentials = vec![cred1, cred2]; - let schema_json = build_schemas_json_verifier(&mock_profile(), &credentials) + let schema_json = build_schemas_json_verifier(&mock_profile().inject_anoncreds_ledger_read(), &credentials) .await .unwrap(); @@ -289,7 +290,9 @@ pub mod unit_tests { timestamp: None, }; let credentials = vec![cred1, cred2]; - let rev_reg_defs_json = build_rev_reg_defs_json(&mock_profile(), &credentials).await.unwrap(); + let rev_reg_defs_json = build_rev_reg_defs_json(&mock_profile().inject_anoncreds_ledger_read(), &credentials) + .await + .unwrap(); let json: Value = serde_json::from_str(&rev_def_json()).unwrap(); let expected = json!({ REV_REG_ID: json }).to_string(); @@ -313,7 +316,9 @@ pub mod unit_tests { timestamp: Some(2), }; let credentials = vec![cred1, cred2]; - let rev_reg_json = build_rev_reg_json(&mock_profile(), &credentials).await.unwrap(); + let rev_reg_json = build_rev_reg_json(&mock_profile().inject_anoncreds_ledger_read(), &credentials) + .await + .unwrap(); let json: Value = serde_json::from_str(REV_REG_JSON).unwrap(); let expected = json!({REV_REG_ID:{"1":json}}).to_string(); diff --git a/aries_vcx/tests/test_agency.rs b/aries_vcx/tests/test_agency.rs index d73dbf69b6..1ed72f2a3a 100644 --- a/aries_vcx/tests/test_agency.rs +++ b/aries_vcx/tests/test_agency.rs @@ -145,9 +145,11 @@ mod integration_tests { info!("test_connection_send_works:: Test if Send Message works"); { - faber.connection.send_message_closure(&faber.profile).await.unwrap()(AriesMessage::from( - message.clone(), - )) + faber + .connection + .send_message_closure(faber.profile.inject_wallet()) + .await + .unwrap()(AriesMessage::from(message.clone())) .await .unwrap(); } @@ -249,9 +251,11 @@ mod integration_tests { let credential_offer = OfferCredential::with_decorators(id, content, decorators); - faber.connection.send_message_closure(&faber.profile).await.unwrap()(AriesMessage::from( - credential_offer, - )) + faber + .connection + .send_message_closure(faber.profile.inject_wallet()) + .await + .unwrap()(AriesMessage::from(credential_offer)) .await .unwrap(); diff --git a/aries_vcx/tests/test_creds_proofs.rs b/aries_vcx/tests/test_creds_proofs.rs index 6ca8e3e27c..003eee7992 100644 --- a/aries_vcx/tests/test_creds_proofs.rs +++ b/aries_vcx/tests/test_creds_proofs.rs @@ -777,7 +777,7 @@ mod tests { prover_select_credentials_and_send_proof(&mut consumer1, &consumer1_to_verifier, None, None).await; proof_verifier .update_state( - &institution.profile.inject_wallet(), &institution.profile.inject_anoncreds_ledger_read(), &institution.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer1) + &verifier.profile.inject_wallet(), &verifier.profile.inject_anoncreds_ledger_read(), &verifier.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer1) .await .unwrap(); assert_eq!( @@ -797,7 +797,12 @@ mod tests { prover_select_credentials_and_send_proof(&mut consumer2, &consumer2_to_verifier, None, None).await; proof_verifier .update_state( - &institution.profile.inject_wallet(), &institution.profile.inject_anoncreds_ledger_read(), &institution.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer2) + &verifier.profile.inject_wallet(), + &verifier.profile.inject_anoncreds_ledger_read(), + &verifier.profile.inject_anoncreds(), + &verifier.agency_client, + &verifier_to_consumer2 + ) .await .unwrap(); assert_eq!( @@ -834,9 +839,9 @@ mod tests { prover_select_credentials_and_send_proof(&mut consumer, &consumer_to_verifier, request_name1, None).await; proof_verifier .update_state( - &institution.profile.inject_wallet(), - &institution.profile.inject_anoncreds_ledger_read(), - &institution.profile.inject_anoncreds(), + &verifier.profile.inject_wallet(), + &verifier.profile.inject_anoncreds_ledger_read(), + &verifier.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer, ) @@ -859,9 +864,9 @@ mod tests { prover_select_credentials_and_send_proof(&mut consumer, &consumer_to_verifier, request_name2, None).await; proof_verifier .update_state( - &institution.profile.inject_wallet(), - &institution.profile.inject_anoncreds_ledger_read(), - &institution.profile.inject_anoncreds(), + &verifier.profile.inject_wallet(), + &verifier.profile.inject_anoncreds_ledger_read(), + &verifier.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer, ) @@ -1045,7 +1050,10 @@ mod tests { let mut prover = create_proof(&mut consumer, &consumer_to_issuer, None).await; info!("test_real_proof :: retrieving matching credentials"); - let retrieved_credentials = prover.retrieve_credentials(&consumer.profile).await.unwrap(); + let retrieved_credentials = prover + .retrieve_credentials(&consumer.profile.inject_anoncreds()) + .await + .unwrap(); let selected_credentials = retrieved_to_selected_credentials_simple(&retrieved_credentials, false); info!("test_real_proof :: generating and sending proof"); @@ -1127,7 +1135,7 @@ mod tests { .await; proof_verifier .update_state( - &institution.profile.inject_wallet(), &institution.profile.inject_anoncreds_ledger_read(), &institution.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer) + &verifier.profile.inject_wallet(), &verifier.profile.inject_anoncreds_ledger_read(), &verifier.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer) .await .unwrap(); assert_eq!( @@ -1147,7 +1155,7 @@ mod tests { .await; proof_verifier .update_state( - &institution.profile.inject_wallet(), &institution.profile.inject_anoncreds_ledger_read(), &institution.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer) + &verifier.profile.inject_wallet(), &verifier.profile.inject_anoncreds_ledger_read(), &verifier.profile.inject_anoncreds(), &verifier.agency_client, &verifier_to_consumer) .await .unwrap(); assert_eq!( diff --git a/aries_vcx/tests/test_creds_proofs_revocations.rs b/aries_vcx/tests/test_creds_proofs_revocations.rs index af06af5c07..22651df766 100644 --- a/aries_vcx/tests/test_creds_proofs_revocations.rs +++ b/aries_vcx/tests/test_creds_proofs_revocations.rs @@ -146,7 +146,7 @@ mod integration_tests { .build() .unwrap(); let send_message = institution_to_consumer - .send_message_closure(&institution.profile) + .send_message_closure(institution.profile.inject_wallet()) .await .unwrap(); aries_vcx::handlers::revocation_notification::sender::RevocationNotificationSender::build() @@ -542,7 +542,7 @@ mod integration_tests { let mut prover = create_proof(&mut consumer, &consumer_to_institution, None).await; info!("test_revoked_credential_might_still_work :: retrieving matching credentials"); - let retrieved_credentials = prover.retrieve_credentials(&consumer.profile).await.unwrap(); + let retrieved_credentials = prover.retrieve_credentials(&consumer.profile.inject_anoncreds()).await.unwrap(); info!( "test_revoked_credential_might_still_work :: prover :: based on proof, retrieved credentials: {:?}", &retrieved_credentials @@ -623,8 +623,8 @@ mod integration_tests { ) .await; - assert!(!issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(!issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(!issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(!issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); revoke_credential_and_publish_accumulator(&mut issuer, &issuer_credential1, &rev_reg).await; @@ -681,8 +681,8 @@ mod integration_tests { PresentationVerificationStatus::Valid ); - assert!(issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(!issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(!issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); }).await; } @@ -727,8 +727,8 @@ mod integration_tests { ) .await; - assert!(!issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(!issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(!issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(!issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); revoke_credential_and_publish_accumulator(&mut issuer, &issuer_credential2, &rev_reg).await; @@ -782,8 +782,8 @@ mod integration_tests { PresentationVerificationStatus::Invalid ); - assert!(!issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(!issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); }).await; } @@ -879,8 +879,8 @@ mod integration_tests { PresentationVerificationStatus::Valid ); - assert!(!issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(!issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(!issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(!issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); }).await; } @@ -926,8 +926,8 @@ mod integration_tests { ) .await; - assert!(!issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(!issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(!issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(!issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); revoke_credential_and_publish_accumulator(&mut issuer, &issuer_credential1, &rev_reg).await; @@ -980,8 +980,8 @@ mod integration_tests { PresentationVerificationStatus::Valid ); - assert!(issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(!issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(!issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); }).await; } @@ -1027,8 +1027,8 @@ mod integration_tests { ) .await; - assert!(!issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(!issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(!issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(!issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); revoke_credential_and_publish_accumulator(&mut issuer, &issuer_credential2, &rev_reg_2).await; @@ -1082,8 +1082,8 @@ mod integration_tests { PresentationVerificationStatus::Invalid ); - assert!(!issuer_credential1.is_revoked(&issuer.profile).await.unwrap()); - assert!(issuer_credential2.is_revoked(&issuer.profile).await.unwrap()); + assert!(!issuer_credential1.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); + assert!(issuer_credential2.is_revoked(&issuer.profile.inject_anoncreds_ledger_read()).await.unwrap()); }).await; } } diff --git a/aries_vcx/tests/utils/devsetup_agent.rs b/aries_vcx/tests/utils/devsetup_agent.rs index bd3af23279..5dad495a3e 100644 --- a/aries_vcx/tests/utils/devsetup_agent.rs +++ b/aries_vcx/tests/utils/devsetup_agent.rs @@ -341,7 +341,7 @@ pub mod test_utils { }; self.issuer_credential = Issuer::create("alice_degree").unwrap(); self.issuer_credential - .build_credential_offer_msg(&self.profile, offer_info, None) + .build_credential_offer_msg(&self.profile.inject_anoncreds(), offer_info, None) .await .unwrap(); self.issuer_credential @@ -414,7 +414,7 @@ pub mod test_utils { .unwrap(); self.verifier .update_state( - &institution.profile.inject_wallet(), + &self.profile.inject_wallet(), &self.profile.inject_anoncreds_ledger_read(), &self.profile.inject_anoncreds(), &self.agency_client, @@ -438,7 +438,7 @@ pub mod test_utils { ) { self.verifier .update_state( - &institution.profile.inject_wallet(), + &self.profile.inject_wallet(), &self.profile.inject_anoncreds_ledger_read(), &self.profile.inject_anoncreds(), &self.agency_client, diff --git a/aries_vcx/tests/utils/scenarios.rs b/aries_vcx/tests/utils/scenarios.rs index a289c90f65..2f91b51159 100644 --- a/aries_vcx/tests/utils/scenarios.rs +++ b/aries_vcx/tests/utils/scenarios.rs @@ -195,7 +195,7 @@ pub mod test_utils { let mut issuer = Issuer::create("1").unwrap(); info!("create_and_send_nonrevocable_cred_offer :: sending credential offer"); issuer - .build_credential_offer_msg(&faber.profile, offer_info, comment.map(String::from)) + .build_credential_offer_msg(&faber.profile.inject_anoncreds(), offer_info, comment.map(String::from)) .await .unwrap(); issuer @@ -230,7 +230,7 @@ pub mod test_utils { let mut issuer = Issuer::create("1").unwrap(); info!("create_and_send_cred_offer :: sending credential offer"); issuer - .build_credential_offer_msg(&faber.profile, offer_info, comment.map(String::from)) + .build_credential_offer_msg(&faber.profile.inject_anoncreds(), offer_info, comment.map(String::from)) .await .unwrap(); issuer @@ -436,7 +436,7 @@ pub mod test_utils { tails_file, }; issuer - .build_credential_offer_msg(&faber.profile, offer_info, Some("comment".into())) + .build_credential_offer_msg(&faber.profile.inject_anoncreds(), offer_info, Some("comment".into())) .await .unwrap(); issuer @@ -479,7 +479,7 @@ pub mod test_utils { tails_file, }; issuer - .build_credential_offer_msg(&faber.profile, offer_info, Some("comment".into())) + .build_credential_offer_msg(&faber.profile.inject_anoncreds(), offer_info, Some("comment".into())) .await .unwrap(); issuer @@ -592,7 +592,13 @@ pub mod test_utils { info!("send_credential >>> storing credential"); assert_eq!(thread_id, holder_credential.get_thread_id().unwrap()); - assert_eq!(holder_credential.is_revokable(&alice.profile).await.unwrap(), revokable); + assert_eq!( + holder_credential + .is_revokable(&alice.profile.inject_anoncreds_ledger_read()) + .await + .unwrap(), + revokable + ); holder_credential .update_state( &alice.profile.inject_anoncreds_ledger_read(), @@ -604,7 +610,13 @@ pub mod test_utils { .await .unwrap(); assert_eq!(HolderState::Finished, holder_credential.get_state()); - assert_eq!(holder_credential.is_revokable(&alice.profile).await.unwrap(), revokable); + assert_eq!( + holder_credential + .is_revokable(&alice.profile.inject_anoncreds_ledger_read()) + .await + .unwrap(), + revokable + ); assert_eq!(thread_id, holder_credential.get_thread_id().unwrap()); if revokable { @@ -645,7 +657,13 @@ pub mod test_utils { cred_def_id: &str, ) { prover - .update_state(&alice.profile.inject_wallet(), &alice.agency_client, connection) + .update_state( + &alice.profile.inject_anoncreds_ledger_read(), + &alice.profile.inject_anoncreds(), + &alice.profile.inject_wallet(), + &alice.agency_client, + connection, + ) .await .unwrap(); assert_eq!(prover.get_state(), ProverState::PresentationRequestReceived); @@ -742,7 +760,13 @@ pub mod test_utils { ) { assert_eq!(prover.get_state(), ProverState::PresentationProposalSent); prover - .update_state(&alice.profile.inject_wallet(), &alice.agency_client, connection) + .update_state( + &alice.profile.inject_anoncreds_ledger_read(), + &alice.profile.inject_anoncreds(), + &alice.profile.inject_wallet(), + &alice.agency_client, + connection, + ) .await .unwrap(); assert_eq!(prover.get_state(), ProverState::Failed); @@ -842,7 +866,12 @@ pub mod test_utils { selected_credentials ); prover - .generate_presentation(&alice.profile, selected_credentials, HashMap::new()) + .generate_presentation( + &alice.profile.inject_anoncreds_ledger_read(), + &alice.profile.inject_anoncreds(), + selected_credentials, + HashMap::new(), + ) .await .unwrap(); assert_eq!(thread_id, prover.get_thread_id().unwrap()); @@ -1104,11 +1133,20 @@ pub mod test_utils { requested_values: Option<&str>, ) -> SelectedCredentials { prover - .update_state(&alice.profile.inject_wallet(), &alice.agency_client, connection) + .update_state( + &alice.profile.inject_anoncreds_ledger_read(), + &alice.profile.inject_anoncreds(), + &alice.profile.inject_wallet(), + &alice.agency_client, + connection, + ) .await .unwrap(); assert_eq!(prover.get_state(), ProverState::PresentationRequestReceived); - let retrieved_credentials = prover.retrieve_credentials(&alice.profile).await.unwrap(); + let retrieved_credentials = prover + .retrieve_credentials(&alice.profile.inject_anoncreds()) + .await + .unwrap(); let selected_credentials = match requested_values { Some(requested_values) => { let credential_data = prover.presentation_request_data().unwrap();