Skip to content

Commit

Permalink
Merge pull request #451 from 0xPolygonID/feature/c-lib-errors
Browse files Browse the repository at this point in the history
feat: c-lib errors
  • Loading branch information
plusema86 authored Nov 4, 2024
2 parents 46c0e08 + 9f9c5d4 commit 58f1f92
Show file tree
Hide file tree
Showing 25 changed files with 500 additions and 403 deletions.
2 changes: 1 addition & 1 deletion android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ apply plugin: 'maven-publish'
// apply plugin: 'signing'

android {
compileSdkVersion 33
compileSdkVersion 34
ndkVersion "26.3.11579264"

compileOptions {
Expand Down
16 changes: 16 additions & 0 deletions android/src/main/jniLibs/arm64-v8a/libpolygonid.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ typedef enum
{
PLGNSTATUSCODE_ERROR,
PLGNSTATUSCODE_NIL_POINTER,
// error extracting credential status from verifiable credential
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
// error resolving credential status (e.g. getting the status from chain of DHS)
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_RESOLVE_ERROR,
// error getting merkletree proof from credential status
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
// merkletree proof is invalid
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_STATE_ERROR,
// credential is revoked
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_REVOKED_ERROR,
// the same as above but for issuer credential (for signature proofs)
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_RESOLVE_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_STATE_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_REVOKED_ERROR,
} PLGNStatusCode;

typedef struct _PLGNStatus
Expand Down
Binary file modified android/src/main/jniLibs/arm64-v8a/libpolygonid.so
Binary file not shown.
24 changes: 20 additions & 4 deletions android/src/main/jniLibs/libpolygonid.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,30 @@ typedef struct { const char *p; ptrdiff_t n; } _GoString_;

typedef enum
{
PLGNSTATUSCODE_ERROR,
PLGNSTATUSCODE_NIL_POINTER,
PLGNSTATUSCODE_ERROR,
PLGNSTATUSCODE_NIL_POINTER,
// error extracting credential status from verifiable credential
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
// error resolving credential status (e.g. getting the status from chain of DHS)
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_RESOLVE_ERROR,
// error getting merkletree proof from credential status
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
// merkletree proof is invalid
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_MT_STATE_ERROR,
// credential is revoked
PLGNSTATUSCODE_USER_CREDENTIAL_STATUS_REVOKED_ERROR,
// the same as above but for issuer credential (for signature proofs)
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_EXTRACTION_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_RESOLVE_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_BUILD_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_MT_STATE_ERROR,
PLGNSTATUSCODE_ISSUER_CREDENTIAL_STATUS_REVOKED_ERROR,
} PLGNStatusCode;

typedef struct _PLGNStatus
{
PLGNStatusCode status;
char *error_msg;
PLGNStatusCode status;
char *error_msg;
} PLGNStatus;

#line 1 "cgo-generated-wrapper"
Expand Down
Loading

0 comments on commit 58f1f92

Please sign in to comment.