Skip to content

Commit

Permalink
fix: return the updated credential from process_credential()
Browse files Browse the repository at this point in the history
Signed-off-by: Benjamin Voiturier <[email protected]>
  • Loading branch information
bvoiturier committed Dec 14, 2023
1 parent 467e4d0 commit a2207db
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion uniffi/src/anoncreds.udl
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ interface Prover {
);

[Throws=AnoncredsError]
void process_credential(
Credential process_credential(
Credential credential,
CredentialRequestMetadata cred_request_metadata,
LinkSecret link_secret,
Expand Down
6 changes: 4 additions & 2 deletions uniffi/src/prover/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ impl Prover {
link_secret: Arc<LinkSecret>,
cred_def: Arc<CredentialDefinition>,
rev_reg_def: Option<Arc<RevocationRegistryDefinition>>,
) -> Result<(), AnoncredsError> {
) -> Result<Arc<Credential>, AnoncredsError> {
let mut mutable_credential = (*credential)
.core
.try_clone()
Expand All @@ -94,7 +94,9 @@ impl Prover {
&(*cred_def).core,
rev_reg_def.as_ref().map(|def| &(*def).core),
)
.map_err(|err| AnoncredsError::ProcessCredential(format!("Error: {}", err)))
.map_err(|err| AnoncredsError::ProcessCredential(format!("Error: {}", err)));

return Ok(Arc::new(Credential { core: mutable_credential }))
}

pub fn create_presentation(
Expand Down

0 comments on commit a2207db

Please sign in to comment.