Skip to content

Commit

Permalink
Added missing method to NodeJS wrapper
Browse files Browse the repository at this point in the history
Signed-off-by: artem.ivanov <[email protected]>
  • Loading branch information
Artemkaaas committed Nov 15, 2023
1 parent 4fae9b1 commit 19edff7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 2 additions & 0 deletions tests/anoncreds_demos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3029,6 +3029,7 @@ fn anoncreds_demo_works_for_issue_w3c_credential_and_present_w3c_presentation()
.expect("Error processing credential");

// Store W3C credential form in wallet
println!("w3c_credential {}", json!(w3c_credential).to_string());
prover_wallet.w3c_credentials.push(w3c_credential);

// Create and Verify W3C presentation using W3C credential
Expand Down Expand Up @@ -3074,6 +3075,7 @@ fn anoncreds_demo_works_for_issue_w3c_credential_and_present_w3c_presentation()
&cred_defs,
)
.expect("Error creating presentation");
println!("presentation {}", json!(presentation).to_string());

// Verifier verifies presentation
assert_eq!(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ export class NodeJSAnoncreds implements Anoncreds {
revocationConfiguration?: NativeCredentialRevocationConfig
encoding?: string
}): ObjectHandle {
const { credentialDefinition, credentialDefinitionPrivate, credentialOffer, credentialRequest } =
const { credentialDefinition, credentialDefinitionPrivate, credentialOffer, credentialRequest, encoding } =
serializeArguments(options)

const attributeNames = StringListStruct({
Expand Down Expand Up @@ -722,7 +722,7 @@ export class NodeJSAnoncreds implements Anoncreds {
attributeNames as unknown as Buffer,
attributeRawValues as unknown as Buffer,
revocationConfiguration?.ref().address() ?? 0,
options.encoding,
encoding,
credentialPtr
)
this.handleError()
Expand Down Expand Up @@ -943,6 +943,17 @@ export class NodeJSAnoncreds implements Anoncreds {
return new ObjectHandle(handleReturnPointer<number>(ret))
}

public w3cCredentialAddNonAnonCredsIntegrityProof(options: { objectHandle: ObjectHandle; proof: string }): ObjectHandle {

Check failure on line 946 in wrappers/javascript/packages/anoncreds-nodejs/src/NodeJSAnoncreds.ts

View workflow job for this annotation

GitHub Actions / Build and Test JavaScript wrapper

Replace `·objectHandle:·ObjectHandle;·proof:·string` with `⏎····objectHandle:·ObjectHandle⏎····proof:·string⏎·`
const { objectHandle, proof } = serializeArguments(options)

const ret = allocatePointer()

this.nativeAnoncreds.anoncreds_w3c_credential_add_non_anoncreds_integrity_proof(objectHandle, proof, ret)
this.handleError()

return new ObjectHandle(handleReturnPointer<number>(ret))
}

public w3cCredentialSetId(options: { objectHandle: ObjectHandle; id: string }): ObjectHandle {
const { objectHandle, id } = serializeArguments(options)

Expand Down

0 comments on commit 19edff7

Please sign in to comment.