Skip to content

Commit

Permalink
fix: Replace with w3c call, change order of enum variants
Browse files Browse the repository at this point in the history
Signed-off-by: Abdulbois <[email protected]>
Signed-off-by: artem.ivanov <[email protected]>
  • Loading branch information
Abdulbois authored and Artemkaaas committed Nov 22, 2023
1 parent e5525c8 commit e2a21ce
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/ffi/w3c/cred_offer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use ffi_support::FfiStr;
/// # Returns
/// Error code
#[no_mangle]
pub extern "C" fn anoncreds_w3c_create_credential_offer(
pub extern "C" fn anoncreds_create_w3c_credential_offer(
schema_id: FfiStr,
cred_def_id: FfiStr,
key_proof: ObjectHandle,
Expand Down
2 changes: 1 addition & 1 deletion src/ffi/w3c/cred_req.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use crate::ffi::object::ObjectHandle;
/// # Returns
/// Error code
#[no_mangle]
pub extern "C" fn anoncreds_w3c_create_credential_request(
pub extern "C" fn anoncreds_create_w3c_credential_request(
entropy: FfiStr,
prover_did: FfiStr,
cred_def: ObjectHandle,
Expand Down
4 changes: 2 additions & 2 deletions src/ffi/w3c/credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ pub extern "C" fn anoncreds_w3c_credential_add_non_anoncreds_integrity_proof(
/// # Returns
/// Error code
#[no_mangle]
pub extern "C" fn anoncreds_w3c_set_credential_id(
pub extern "C" fn anoncreds_w3c_credential_set_id(
cred: ObjectHandle,
id: FfiStr,
cred_p: *mut ObjectHandle,
Expand Down Expand Up @@ -252,7 +252,7 @@ pub extern "C" fn anoncreds_w3c_set_credential_id(
/// # Returns
/// Error code
#[no_mangle]
pub extern "C" fn anoncreds_credential_w3c_subject_id(
pub extern "C" fn anoncreds_w3c_credential_set_subject_id(
cred: ObjectHandle,
id: FfiStr,
cred_p: *mut ObjectHandle,
Expand Down
4 changes: 2 additions & 2 deletions src/ffi/w3c/presentation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<FfiCredentialEntry>,
credentials_prove: FfiList<FfiCredentialProve>,
Expand Down Expand Up @@ -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<ObjectHandle>,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,8 @@ export const nativeBindings = {
FFI_OBJECT_HANDLE,
StringListStruct,
StringListStruct,
FFI_OBJECT_HANDLE,
FFI_STRING,
FFI_OBJECT_HANDLE,
FFI_OBJECT_HANDLE_PTR
]
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion wrappers/python/anoncreds/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2a21ce

Please sign in to comment.