Skip to content

Commit

Permalink
Address code review
Browse files Browse the repository at this point in the history
Signed-off-by: Patrik Stas <[email protected]>
  • Loading branch information
Patrik-Stas committed Aug 29, 2023
1 parent 4708c07 commit 39ba378
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions aries_vcx_core/src/anoncreds/credx_anoncreds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,13 @@ impl IndyCredxAnonCreds {
attrs.push(Value::Object(restriction));
json!({ "$and": attrs })
}
_ => json!(attrs),
_ => Err(AriesVcxCoreError::from_msg(
AriesVcxCoreErrorKind::InvalidInput,
"Invalid attribute restrictions (must be array or an object)",
))?
}
} else {
json!(attrs)
json!({ "$and": attrs })
};

let wql_query = serde_json::to_string(&wql_query)?;
Expand Down Expand Up @@ -751,7 +754,7 @@ impl BaseAnonCreds for IndyCredxAnonCreds {
.map(|v| v.try_as_str().map(_normalize_attr_name))
.collect::<Result<_, _>>()?,
_ => Err(AriesVcxCoreError::from_msg(
AriesVcxCoreErrorKind::InvalidAttributesStructure,
AriesVcxCoreErrorKind::InvalidInput,
"exactly one of 'name' or 'names' must be present",
))?,
};
Expand Down

0 comments on commit 39ba378

Please sign in to comment.