Skip to content

Commit

Permalink
patch: fix test failures
Browse files Browse the repository at this point in the history
Signed-off-by: Akiff Manji <akiff.manji@quartech.com>
  • Loading branch information
amanji committed Jul 25, 2023
1 parent 043d56d commit 577460d
Showing 1 changed file with 12 additions and 37 deletions.
49 changes: 12 additions & 37 deletions wrappers/python/anoncreds/bindings.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,6 @@ def __repr__(self) -> str:
type_name = "<none>"
return f"{self.__class__.__name__}({type_name}, {self.value})"

def __del__(self):
object_free(self)

@classmethod
def _cleanup(cls, value: c_int64):
"""Destructor."""
Expand Down Expand Up @@ -262,6 +259,7 @@ def create(cls, values: Optional[Iterable[int]]) -> "FfiIntList":
inst.data = (c_int64 * inst.count)(*ffi_values)
return inst


class FfiInt32List(Structure):
_fields_ = [
("count", c_size_t),
Expand All @@ -277,6 +275,7 @@ def create(cls, values: Optional[Sequence[int]]) -> "FfiInt32List":
inst.data = (c_int32 * inst.count)(*ffi_values)
return inst


class FfiStrList(Structure):
_fields_ = [
("count", c_size_t),
Expand Down Expand Up @@ -358,12 +357,14 @@ def predicate(
reveal=True,
)


class CredentialProveList(Structure):
_fields_ = [
("count", c_int64),
("data", POINTER(CredentialProve)),
]


class NonrevokedIntervalOverride(Structure):
_fields_ = [
("rev_reg_def_id", c_char_p),
Expand All @@ -384,12 +385,14 @@ def create(
override_rev_status_list_ts=override_rev_status_list_ts,
)


class NonrevokedIntervalOverrideList(Structure):
_fields_ = [
("count", c_int64),
("data", POINTER(NonrevokedIntervalOverride)),
]


class RevocationConfig(Structure):
_fields_ = [
("rev_reg_def", ObjectHandle),
Expand All @@ -416,36 +419,6 @@ def create(
return config


class RevocationEntry(Structure):
_fields_ = [
("def_entry_idx", c_int64),
("registry", ObjectHandle),
("timestamp", c_int64),
]

@classmethod
def create(
cls,
def_entry_idx: int,
registry: AnoncredsObject,
timestamp: int,
) -> "RevocationEntry":
entry = RevocationEntry(
def_entry_idx=def_entry_idx,
registry=registry.handle,
timestamp=timestamp,
)
keepalive(entry, registry)
return entry


class RevocationEntryList(Structure):
_fields_ = [
("count", c_int64),
("data", POINTER(RevocationEntry)),
]


def get_library() -> CDLL:
"""Return the CDLL instance, loading it if necessary."""
global LIB
Expand Down Expand Up @@ -723,6 +696,7 @@ def process_credential(
)
return result


def create_credential_offer(
schema_id: str, cred_def_id: str, key_proof: ObjectHandle
) -> ObjectHandle:
Expand Down Expand Up @@ -804,6 +778,7 @@ def create_presentation(
)
return present


def verify_presentation(
presentation: ObjectHandle,
pres_req: ObjectHandle,
Expand Down Expand Up @@ -884,8 +859,8 @@ def create_revocation_status_list(
rev_reg_def,
rev_reg_def_private,
encode_str(issuer_id),
int(issuance_by_default),
timestamp if timestamp else -1,
c_int8(issuance_by_default),
c_int64(timestamp if timestamp else -1),
byref(revocation_status_list),
)
return revocation_status_list
Expand All @@ -910,7 +885,7 @@ def update_revocation_status_list(
rev_current_list,
FfiInt32List.create(issued),
FfiInt32List.create(revoked),
timestamp if timestamp else -1,
c_int64(timestamp if timestamp else -1),
byref(new_revocation_status_list),
)

Expand All @@ -925,7 +900,7 @@ def update_revocation_status_list_timestamp_only(

do_call(
"anoncreds_update_revocation_status_list_timestamp_only",
timestamp,
c_int64(timestamp),
rev_current_list.handle,
byref(new_revocation_status_list)
)
Expand Down

0 comments on commit 577460d

Please sign in to comment.