Skip to content

Commit

Permalink
remove credx
Browse files Browse the repository at this point in the history
Signed-off-by: gmulhearn <[email protected]>
  • Loading branch information
gmulhearn committed Oct 11, 2024
1 parent d9aeb42 commit cbb2117
Show file tree
Hide file tree
Showing 27 changed files with 44 additions and 2,003 deletions.
42 changes: 1 addition & 41 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", tag = "v0.4.3"
"log",
] }
indy-vdr-proxy-client = { git = "https://github.com/hyperledger/indy-vdr.git", tag = "v0.4.3" }
indy-credx = { git = "https://github.com/hyperledger/indy-shared-rs", tag = "v1.1.0" }
anoncreds = { git = "https://github.com/hyperledger/anoncreds-rs.git", tag = "v0.2.0" }
aries-askar = { version = "0.3.1" }
askar-crypto = { version = "0.3.1", default-features = false }
2 changes: 1 addition & 1 deletion aries/agents/aries-vcx-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ aries_vcx = { path = "../../aries_vcx" }
aries_vcx_wallet = { path = "../../aries_vcx_wallet", features = [
"askar_wallet",
] }
aries_vcx_anoncreds = { path = "../../aries_vcx_anoncreds", features = ["credx"] }
aries_vcx_anoncreds = { path = "../../aries_vcx_anoncreds", features = ["anoncreds"] }
aries_vcx_ledger = { path = "../../aries_vcx_ledger"}
anoncreds_types = { path = "../../misc/anoncreds_types" }
shared = { path = "../../misc/shared" }
Expand Down
6 changes: 3 additions & 3 deletions aries/agents/aries-vcx-agent/src/agent/agent_struct.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::sync::Arc;

use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_ledger::ledger::indy_vdr_ledger::{DefaultIndyLedgerRead, DefaultIndyLedgerWrite};
use aries_vcx_wallet::wallet::base_wallet::BaseWallet;

Expand All @@ -16,7 +16,7 @@ pub struct Agent<W> {
pub(super) issuer_did: String,
pub(super) ledger_read: Arc<DefaultIndyLedgerRead>,
pub(super) ledger_write: Arc<DefaultIndyLedgerWrite>,
pub(super) anoncreds: IndyCredxAnonCreds,
pub(super) anoncreds: Anoncreds,
pub(super) wallet: Arc<W>,
pub(super) connections: Arc<ServiceConnections<W>>,
pub(super) schemas: Arc<ServiceSchemas<W>>,
Expand Down Expand Up @@ -64,7 +64,7 @@ impl<T: BaseWallet> Agent<T> {
&self.ledger_write
}

pub fn anoncreds(&self) -> &IndyCredxAnonCreds {
pub fn anoncreds(&self) -> &Anoncreds {
&self.anoncreds
}

Expand Down
6 changes: 3 additions & 3 deletions aries/agents/aries-vcx-agent/src/agent/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use aries_vcx::{
};
use aries_vcx_anoncreds::{
self,
anoncreds::{base_anoncreds::BaseAnonCreds, credx_anoncreds::IndyCredxAnonCreds},
anoncreds::{anoncreds::Anoncreds, base_anoncreds::BaseAnonCreds},
errors::error::VcxAnoncredsError,
};
use aries_vcx_ledger::ledger::indy_vdr_ledger::{
Expand Down Expand Up @@ -62,7 +62,7 @@ pub async fn build_askar_wallet(
let wallet = config_wallet.create_wallet().await.unwrap();
let config_issuer = wallet.configure_issuer(&issuer_seed).await.unwrap();

let anoncreds = IndyCredxAnonCreds;
let anoncreds = Anoncreds;

if let Err(err) = anoncreds
.prover_create_link_secret(&wallet, &DEFAULT_LINK_SECRET_ALIAS.to_string())
Expand Down Expand Up @@ -123,7 +123,7 @@ impl<W: BaseWallet> Agent<W> {
genesis_file_path: genesis_path,
};

let anoncreds = IndyCredxAnonCreds;
let anoncreds = Anoncreds;
let (ledger_read, ledger_write) = build_ledger_components(vcx_pool_config.clone()).unwrap();

let ledger_read = Arc::new(ledger_read);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::sync::{Arc, Mutex};

use anoncreds_types::data_types::identifiers::schema_id::SchemaId;
use aries_vcx::{common::primitives::credential_definition::CredentialDef, did_parser_nom::Did};
use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_ledger::ledger::indy_vdr_ledger::{DefaultIndyLedgerRead, DefaultIndyLedgerWrite};
use aries_vcx_wallet::wallet::base_wallet::BaseWallet;

Expand All @@ -14,7 +14,7 @@ use crate::{
pub struct ServiceCredentialDefinitions<T> {
ledger_read: Arc<DefaultIndyLedgerRead>,
ledger_write: Arc<DefaultIndyLedgerWrite>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
cred_defs: AgentStorageInMem<CredentialDef>,
}
Expand All @@ -23,7 +23,7 @@ impl<T: BaseWallet> ServiceCredentialDefinitions<T> {
pub fn new(
ledger_read: Arc<DefaultIndyLedgerRead>,
ledger_write: Arc<DefaultIndyLedgerWrite>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
) -> Self {
Self {
Expand Down
6 changes: 3 additions & 3 deletions aries/agents/aries-vcx-agent/src/handlers/holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use aries_vcx::{
},
protocols::{issuance::holder::state_machine::HolderState, SendClosure},
};
use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_ledger::ledger::indy_vdr_ledger::DefaultIndyLedgerRead;
use aries_vcx_wallet::wallet::base_wallet::BaseWallet;

Expand Down Expand Up @@ -40,7 +40,7 @@ impl HolderWrapper {

pub struct ServiceCredentialsHolder<T> {
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
creds_holder: AgentStorageInMem<HolderWrapper>,
service_connections: Arc<ServiceConnections<T>>,
Expand All @@ -49,7 +49,7 @@ pub struct ServiceCredentialsHolder<T> {
impl<T: BaseWallet> ServiceCredentialsHolder<T> {
pub fn new(
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
service_connections: Arc<ServiceConnections<T>>,
) -> Self {
Expand Down
6 changes: 3 additions & 3 deletions aries/agents/aries-vcx-agent/src/handlers/issuer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use aries_vcx::{
},
protocols::{issuance::issuer::state_machine::IssuerState, SendClosure},
};
use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_wallet::wallet::base_wallet::BaseWallet;

use crate::{
Expand All @@ -37,15 +37,15 @@ impl IssuerWrapper {
}

pub struct ServiceCredentialsIssuer<T> {
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
creds_issuer: AgentStorageInMem<IssuerWrapper>,
service_connections: Arc<ServiceConnections<T>>,
}

impl<T: BaseWallet> ServiceCredentialsIssuer<T> {
pub fn new(
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
service_connections: Arc<ServiceConnections<T>>,
) -> Self {
Expand Down
6 changes: 3 additions & 3 deletions aries/agents/aries-vcx-agent/src/handlers/prover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use aries_vcx::{
},
protocols::{proof_presentation::prover::state_machine::ProverState, SendClosure},
};
use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_ledger::ledger::indy_vdr_ledger::DefaultIndyLedgerRead;
use aries_vcx_wallet::wallet::base_wallet::BaseWallet;
use serde_json::Value;
Expand Down Expand Up @@ -40,7 +40,7 @@ impl ProverWrapper {

pub struct ServiceProver<T> {
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
provers: AgentStorageInMem<ProverWrapper>,
service_connections: Arc<ServiceConnections<T>>,
Expand All @@ -49,7 +49,7 @@ pub struct ServiceProver<T> {
impl<T: BaseWallet> ServiceProver<T> {
pub fn new(
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
service_connections: Arc<ServiceConnections<T>>,
) -> Self {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::{

use anoncreds_types::data_types::identifiers::cred_def_id::CredentialDefinitionId;
use aries_vcx::{common::primitives::revocation_registry::RevocationRegistry, did_parser_nom::Did};
use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_ledger::ledger::indy_vdr_ledger::{DefaultIndyLedgerRead, DefaultIndyLedgerWrite};
use aries_vcx_wallet::wallet::base_wallet::BaseWallet;

Expand All @@ -17,7 +17,7 @@ use crate::{
pub struct ServiceRevocationRegistries<T> {
ledger_write: Arc<DefaultIndyLedgerWrite>,
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
issuer_did: Did,
rev_regs: AgentStorageInMem<RevocationRegistry>,
Expand All @@ -27,7 +27,7 @@ impl<T: BaseWallet> ServiceRevocationRegistries<T> {
pub fn new(
ledger_write: Arc<DefaultIndyLedgerWrite>,
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
issuer_did: String,
) -> Self {
Expand Down
6 changes: 3 additions & 3 deletions aries/agents/aries-vcx-agent/src/handlers/schema.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::sync::{Arc, Mutex};

use aries_vcx::{common::primitives::credential_schema::Schema, did_parser_nom::Did};
use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_ledger::ledger::{
base_ledger::AnoncredsLedgerRead,
indy_vdr_ledger::{DefaultIndyLedgerRead, DefaultIndyLedgerWrite},
Expand All @@ -16,7 +16,7 @@ use crate::{
pub struct ServiceSchemas<T> {
ledger_read: Arc<DefaultIndyLedgerRead>,
ledger_write: Arc<DefaultIndyLedgerWrite>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
issuer_did: Did,
schemas: AgentStorageInMem<Schema>,
Expand All @@ -26,7 +26,7 @@ impl<T: BaseWallet> ServiceSchemas<T> {
pub fn new(
ledger_read: Arc<DefaultIndyLedgerRead>,
ledger_write: Arc<DefaultIndyLedgerWrite>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
issuer_did: String,
) -> Self {
Expand Down
6 changes: 3 additions & 3 deletions aries/agents/aries-vcx-agent/src/handlers/verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ use aries_vcx::{
SendClosure,
},
};
use aries_vcx_anoncreds::anoncreds::credx_anoncreds::IndyCredxAnonCreds;
use aries_vcx_anoncreds::anoncreds::anoncreds::Anoncreds;
use aries_vcx_ledger::ledger::indy_vdr_ledger::DefaultIndyLedgerRead;
use aries_vcx_wallet::wallet::base_wallet::BaseWallet;

Expand Down Expand Up @@ -44,7 +44,7 @@ impl VerifierWrapper {

pub struct ServiceVerifier<T> {
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
verifiers: AgentStorageInMem<VerifierWrapper>,
service_connections: Arc<ServiceConnections<T>>,
Expand All @@ -53,7 +53,7 @@ pub struct ServiceVerifier<T> {
impl<T: BaseWallet> ServiceVerifier<T> {
pub fn new(
ledger_read: Arc<DefaultIndyLedgerRead>,
anoncreds: IndyCredxAnonCreds,
anoncreds: Anoncreds,
wallet: Arc<T>,
service_connections: Arc<ServiceConnections<T>>,
) -> Self {
Expand Down
6 changes: 0 additions & 6 deletions aries/aries_vcx/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,10 @@ path = "src/lib.rs"
doctest = false

[features]
credx = [
"aries_vcx_anoncreds/credx",
"test_utils/askar_wallet",
"test_utils/credx"
]
anoncreds = ["aries_vcx_anoncreds/anoncreds", "test_utils/anoncreds", "test_utils/askar_wallet"]
vdr_proxy_ledger = [
"aries_vcx_wallet/askar_wallet",
"test_utils/vdr_proxy_ledger",
"credx",
]
backtrace_errors = ["backtrace"]

Expand Down
2 changes: 1 addition & 1 deletion aries/aries_vcx/src/common/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ pub async fn get_verkey_from_ledger(
//
// #[tokio::test]
// #[ignore]
// #[cfg(all(not(feature = "vdr_proxy_ledger"), not(feature = "credx"),))]
// #[cfg(all(not(feature = "vdr_proxy_ledger")))]
// async fn test_pool_rotate_verkey_fails() {
// use super::*;
//
Expand Down
3 changes: 0 additions & 3 deletions aries/aries_vcx/tests/test_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,6 @@ async fn test_pool_rev_reg_def_fails_for_cred_def_created_without_revocation(
)
.await;

#[cfg(feature = "credx")]
assert_eq!(rc.unwrap_err().kind(), AriesVcxErrorKind::InvalidState);
#[cfg(not(feature = "credx"))]
assert_eq!(rc.unwrap_err().kind(), AriesVcxErrorKind::InvalidInput);
Ok(())
}
Expand Down
2 changes: 0 additions & 2 deletions aries/aries_vcx_anoncreds/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,10 @@ edition.workspace = true

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
credx = ["dep:indy-credx"]
anoncreds = ["dep:anoncreds"]
legacy_proof = []

[dependencies]
indy-credx = { workspace = true, optional = true }
anoncreds = { workspace = true, optional = true }
aries_vcx_wallet = { path = "../aries_vcx_wallet" }
anoncreds_types = { path = "../misc/anoncreds_types" }
Expand Down
2 changes: 1 addition & 1 deletion aries/aries_vcx_anoncreds/src/anoncreds/anoncreds/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ fn from_revocation_status_list_to_revocation_registry_delta(
})
}

#[derive(Debug)]
#[derive(Debug, Copy, Clone)]
pub struct Anoncreds;

#[derive(Debug, Deserialize, Serialize, Clone)]
Expand Down
Loading

0 comments on commit cbb2117

Please sign in to comment.