Skip to content

Commit

Permalink
Update indy-vdr (#935)
Browse files Browse the repository at this point in the history
* Update indy-vdr to latest main revision

---------

Signed-off-by: Miroslav Kovar <miroslav.kovar@absa.africa>
  • Loading branch information
mirgee authored Aug 14, 2023
1 parent 0d593ce commit 773113c
Show file tree
Hide file tree
Showing 5 changed files with 87 additions and 67 deletions.
127 changes: 68 additions & 59 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions aries_vcx_core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ legacy_proof = []

[dependencies]
agency_client = { path = "../agency_client" }
indy-vdr = { git = "https://github.com/Patrik-Stas/indy-vdr.git", rev = "3cd499ad75", default-features = false, features = ["log"] }
indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "879e29e", default-features = false, features = ["log"] }
indy-credx = { git = "https://github.com/hyperledger/indy-shared-rs", tag = "v1.0.1", optional = true }
libvdrtools = { path = "../libvdrtools", optional = true }
indy-api-types = { path = "../libvdrtools/indy-api-types" }
Expand All @@ -32,7 +32,7 @@ lazy_static = "1.4.0"
derive_builder = "0.12.0"
uuid = { version = "1.3.0", default-features = false, features = ["v4"] }
tokio = { version = "1.20" }
indy-vdr-proxy-client = { git = "https://github.com/Patrik-Stas/indy-vdr.git", rev = "3cd499ad75", optional = true }
indy-vdr-proxy-client = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "879e29e", optional = true }
indy-ledger-response-parser = { path = "../indy_ledger_response_parser" }
lru = { version = "0.10.0" }

Expand Down
1 change: 1 addition & 0 deletions aries_vcx_core/src/errors/mapping_indyvdr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ impl From<VdrError> for AriesVcxCoreError {
VdrErrorKind::PoolRequestFailed(_) => {
AriesVcxCoreError::from_msg(AriesVcxCoreErrorKind::InvalidLedgerResponse, err)
}
VdrErrorKind::Resolver => AriesVcxCoreError::from_msg(AriesVcxCoreErrorKind::UnknownError, err),
VdrErrorKind::PoolTimeout => AriesVcxCoreError::from_msg(AriesVcxCoreErrorKind::UnknownError, err),
}
}
Expand Down
20 changes: 15 additions & 5 deletions aries_vcx_core/src/ledger/indy_vdr_ledger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ pub use indy_ledger_response_parser::GetTxnAuthorAgreementData;
use indy_ledger_response_parser::{ResponseParser, RevocationRegistryDeltaInfo, RevocationRegistryInfo};
use indy_vdr as vdr;
use std::fmt::{Debug, Formatter};
use std::str::FromStr;
use std::sync::{Arc, RwLock};
use time::OffsetDateTime;
use vdr::ledger::constants::UpdateRole;
use vdr::ledger::requests::cred_def::CredentialDefinitionV1;
use vdr::ledger::requests::rev_reg::{RevocationRegistryDelta, RevocationRegistryDeltaV1};
use vdr::ledger::requests::rev_reg_def::{RegistryType, RevocationRegistryDefinition, RevocationRegistryDefinitionV1};
Expand Down Expand Up @@ -189,9 +191,15 @@ where
async fn get_attr(&self, target_did: &str, attr_name: &str) -> VcxCoreResult<String> {
debug!("get_attr >> target_did: {target_did}, attr_name: {attr_name}");
let dest = DidValue::from_str(target_did)?;
let request =
self.request_builder()?
.build_get_attrib_request(None, &dest, Some(attr_name.to_string()), None, None)?;
let request = self.request_builder()?.build_get_attrib_request(
None,
&dest,
Some(attr_name.to_string()),
None,
None,
None,
None,
)?;
let response = self.submit_request(None, request).await?;
debug!("get_attr << response: {response}");
Ok(response)
Expand All @@ -200,7 +208,7 @@ where
async fn get_nym(&self, did: &str) -> VcxCoreResult<String> {
debug!("get_nym >> did: {did}");
let dest = DidValue::from_str(did)?;
let request = self.request_builder()?.build_get_nym_request(None, &dest)?;
let request = self.request_builder()?.build_get_nym_request(None, &dest, None, None)?;
let response = self.submit_request(None, request).await?;
debug!("get_nym << response: {response}");
Ok(response)
Expand Down Expand Up @@ -275,7 +283,9 @@ where
&dest,
verkey.map(String::from),
data.map(String::from),
role.map(String::from),
role.map(UpdateRole::from_str).transpose()?,
None,
None,
)?;
let request = self.append_txn_author_agreement_to_request(request).await?;
self.sign_and_submit_request(submitter_did, request).await
Expand Down
2 changes: 1 addition & 1 deletion indy_ledger_response_parser/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ edition = "2021"
serde = { version = "1.0.163", features = ["derive"] }
serde_json = "1.0.96"
time = "=0.3.20"
indy-vdr = { git = "https://github.com/Patrik-Stas/indy-vdr.git", rev = "3cd499ad75", default-features = false, features = ["log"] }
indy-vdr = { git = "https://github.com/hyperledger/indy-vdr.git", rev = "879e29e", default-features = false, features = ["log"] }
thiserror = "1.0.44"
anoncreds-clsignatures = "0.2.0"

0 comments on commit 773113c

Please sign in to comment.