Skip to content

Commit

Permalink
Fix credx_annocreds
Browse files Browse the repository at this point in the history
Signed-off-by: Bhavy Airi <airiragahv@gmail.com>
  • Loading branch information
Bhavy Airi committed May 23, 2023
1 parent 362a418 commit c3585d6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions aries_vcx_core/src/anoncreds/credx_anoncreds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ impl IndyCredxAnonCreds {
async fn get_link_secret(&self, link_secret_id: &str) -> VcxCoreResult<MasterSecret> {
let record = self
.wallet
.get_wallet_record(CATEGORY_LINK_SECRET, link_secret_id, "{}".to_string())
.get_wallet_record(CATEGORY_LINK_SECRET, link_secret_id, "{}")
.await?;

let record: Value = serde_json::from_str(&record)?;
Expand All @@ -70,7 +70,7 @@ impl IndyCredxAnonCreds {
async fn _get_credential(&self, credential_id: &str) -> VcxCoreResult<CredxCredential> {
let cred_record = self
.wallet
.get_wallet_record(CATEGORY_CREDENTIAL, credential_id, "{}".to_string())
.get_wallet_record(CATEGORY_CREDENTIAL, credential_id, "{}")
.await?;
let cred_record: Value = serde_json::from_str(&cred_record)?;
let cred_record_value = (&cred_record).try_get("value")?;
Expand Down Expand Up @@ -606,7 +606,7 @@ impl BaseAnonCreds for IndyCredxAnonCreds {
let credential_id = cred_id.map_or(Uuid::new_v4().to_string(), String::from);

let record_value = serde_json::to_string(&credential)?;
let tags_json: HashMap<String, String> = serde_json::from_value(&tags)?;
let tags_json: HashMap<String, String> = serde_json::from_value(tags)?;

self.wallet
.add_wallet_record(CATEGORY_CREDENTIAL, &credential_id, &record_value, Some(tags_json))
Expand All @@ -618,7 +618,7 @@ impl BaseAnonCreds for IndyCredxAnonCreds {
async fn prover_create_link_secret(&self, link_secret_id: &str) -> VcxCoreResult<String> {
let existing_record = self
.wallet
.get_wallet_record(CATEGORY_LINK_SECRET, link_secret_id, "{}".to_string())
.get_wallet_record(CATEGORY_LINK_SECRET, link_secret_id, "{}")
.await
.ok(); // ignore error, as we only care about whether it exists or not

Expand Down

0 comments on commit c3585d6

Please sign in to comment.