From 6d64da49341b0c235beaff2fb8b9fe716a3118a2 Mon Sep 17 00:00:00 2001 From: Abdulbois Date: Tue, 21 Nov 2023 20:30:31 +0500 Subject: [PATCH] fix: Replace with w3c call, change order of enum variants Signed-off-by: Abdulbois Signed-off-by: artem.ivanov --- src/ffi/w3c/presentation.rs | 4 ++-- .../packages/anoncreds-nodejs/src/NodeJSAnoncreds.ts | 2 +- .../packages/anoncreds-nodejs/src/library/bindings.ts | 2 +- .../packages/anoncreds-shared/src/api/W3CCredential.ts | 2 +- wrappers/python/anoncreds/bindings.py | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ffi/w3c/presentation.rs b/src/ffi/w3c/presentation.rs index 40e9b6aa..c3cfb45a 100644 --- a/src/ffi/w3c/presentation.rs +++ b/src/ffi/w3c/presentation.rs @@ -31,7 +31,7 @@ impl_anoncreds_object_from_json!(W3CPresentation, anoncreds_w3c_presentation_fro /// # Returns /// Error code #[no_mangle] -pub extern "C" fn anoncreds_w3c_create_presentation( +pub extern "C" fn anoncreds_create_w3c_presentation( pres_req: ObjectHandle, credentials: FfiList, credentials_prove: FfiList, @@ -83,7 +83,7 @@ pub extern "C" fn anoncreds_w3c_create_presentation( /// # Returns /// Error code #[no_mangle] -pub extern "C" fn anoncreds_w3c_verify_presentation( +pub extern "C" fn anoncreds_verify_w3c_presentation( presentation: ObjectHandle, pres_req: ObjectHandle, schemas: FfiList, diff --git a/wrappers/javascript/packages/anoncreds-nodejs/src/NodeJSAnoncreds.ts b/wrappers/javascript/packages/anoncreds-nodejs/src/NodeJSAnoncreds.ts index a2725c11..5f25e62c 100644 --- a/wrappers/javascript/packages/anoncreds-nodejs/src/NodeJSAnoncreds.ts +++ b/wrappers/javascript/packages/anoncreds-nodejs/src/NodeJSAnoncreds.ts @@ -721,8 +721,8 @@ export class NodeJSAnoncreds implements Anoncreds { credentialRequest, attributeNames as unknown as Buffer, attributeRawValues as unknown as Buffer, - revocationConfiguration?.ref().address() ?? 0, encoding, + revocationConfiguration?.ref().address() ?? 0, credentialPtr ) this.handleError() diff --git a/wrappers/javascript/packages/anoncreds-nodejs/src/library/bindings.ts b/wrappers/javascript/packages/anoncreds-nodejs/src/library/bindings.ts index 5533faca..ce88c874 100644 --- a/wrappers/javascript/packages/anoncreds-nodejs/src/library/bindings.ts +++ b/wrappers/javascript/packages/anoncreds-nodejs/src/library/bindings.ts @@ -218,8 +218,8 @@ export const nativeBindings = { FFI_OBJECT_HANDLE, StringListStruct, StringListStruct, - FFI_OBJECT_HANDLE, FFI_STRING, + FFI_OBJECT_HANDLE, FFI_OBJECT_HANDLE_PTR ] ], diff --git a/wrappers/javascript/packages/anoncreds-shared/src/api/W3CCredential.ts b/wrappers/javascript/packages/anoncreds-shared/src/api/W3CCredential.ts index 3246c70e..7ae213fc 100644 --- a/wrappers/javascript/packages/anoncreds-shared/src/api/W3CCredential.ts +++ b/wrappers/javascript/packages/anoncreds-shared/src/api/W3CCredential.ts @@ -83,7 +83,7 @@ export class W3CCredential extends AnoncredsObject { } public static fromJson(json: JsonObject) { - return new W3CCredential(anoncreds.credentialFromJson({ json: JSON.stringify(json) }).handle) + return new W3CCredential(anoncreds.w3cCredentialFromJson({ json: JSON.stringify(json) }).handle) } public process(options: ProcessW3CCredentialOptions) { diff --git a/wrappers/python/anoncreds/bindings.py b/wrappers/python/anoncreds/bindings.py index 9d7fbb73..4e5de89a 100644 --- a/wrappers/python/anoncreds/bindings.py +++ b/wrappers/python/anoncreds/bindings.py @@ -1024,10 +1024,10 @@ def create_w3c_credential( cred_request, names_list, raw_values_list, + encode_str(encoding), pointer(revocation_config) if revocation_config else POINTER(RevocationConfig)(), - encode_str(encoding), byref(cred), ) return cred