diff --git a/aries_vcx_core/src/anoncreds/credx_anoncreds.rs b/aries_vcx_core/src/anoncreds/credx_anoncreds.rs index 9182857af8..1fc8239a59 100644 --- a/aries_vcx_core/src/anoncreds/credx_anoncreds.rs +++ b/aries_vcx_core/src/anoncreds/credx_anoncreds.rs @@ -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)?; @@ -751,7 +754,7 @@ impl BaseAnonCreds for IndyCredxAnonCreds { .map(|v| v.try_as_str().map(_normalize_attr_name)) .collect::>()?, _ => Err(AriesVcxCoreError::from_msg( - AriesVcxCoreErrorKind::InvalidAttributesStructure, + AriesVcxCoreErrorKind::InvalidInput, "exactly one of 'name' or 'names' must be present", ))?, };