Skip to content

Commit

Permalink
Merge branch 'main' into 1.1.1rc0
Browse files Browse the repository at this point in the history
  • Loading branch information
swcurran authored Dec 3, 2024
2 parents 4bb6eda + a6c3b52 commit 3b25e7a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
50 changes: 29 additions & 21 deletions demo/features/steps/0453-issue-credential.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ def step_impl(context, holder):
agent["agent"], "/issue-credential-2.0/records/" + cred_ex_id
)
context.cred_exchange = cred_exchange
print("rev_reg_id:", cred_exchange["indy"]["rev_reg_id"])
print("cred_rev_id:", cred_exchange["indy"]["cred_rev_id"])
_format = "indy" if cred_exchange.get("indy") else "anoncreds"
print("rev_reg_id:", cred_exchange[_format]["rev_reg_id"])
print("cred_rev_id:", cred_exchange[_format]["cred_rev_id"])
print("connection_id:", cred_exchange["cred_ex_record"]["connection_id"])

# revoke the credential
Expand All @@ -184,8 +185,8 @@ def step_impl(context, holder):
agent["agent"],
endpoint,
data={
"rev_reg_id": cred_exchange["indy"]["rev_reg_id"],
"cred_rev_id": cred_exchange["indy"]["cred_rev_id"],
"rev_reg_id": cred_exchange[_format]["rev_reg_id"],
"cred_rev_id": cred_exchange[_format]["cred_rev_id"],
"publish": "Y",
"connection_id": cred_exchange["cred_ex_record"]["connection_id"],
},
Expand All @@ -208,19 +209,22 @@ def step_impl(context, holder):

# get the required revocation info from the last credential exchange
cred_exchange = context.cred_exchange
print("rev_reg_id:", cred_exchange["indy"]["rev_reg_id"])
print("cred_rev_id:", cred_exchange["indy"]["cred_rev_id"])
_format = "indy" if cred_exchange.get("indy") else "anoncreds"
print("rev_reg_id:", cred_exchange[_format]["rev_reg_id"])
print("cred_rev_id:", cred_exchange[_format]["cred_rev_id"])
print("connection_id:", cred_exchange["cred_ex_record"]["connection_id"])

# check wallet status
wallet_revoked_creds = agent_container_GET(
agent["agent"],
"/revocation/registry/" + cred_exchange["indy"]["rev_reg_id"] + "/issued/details",
"/revocation/registry/"
+ cred_exchange[_format]["rev_reg_id"]
+ "/issued/details",
)
print("wallet_revoked_creds:", wallet_revoked_creds)
matched = False
for rec in wallet_revoked_creds:
if rec["cred_rev_id"] == cred_exchange["indy"]["cred_rev_id"]:
if rec["cred_rev_id"] == cred_exchange[_format]["cred_rev_id"]:
matched = True
assert rec["state"] == "revoked"
assert matched
Expand All @@ -229,18 +233,18 @@ def step_impl(context, holder):
ledger_revoked_creds = agent_container_GET(
agent["agent"],
"/revocation/registry/"
+ cred_exchange["indy"]["rev_reg_id"]
+ cred_exchange[_format]["rev_reg_id"]
+ "/issued/indy_recs",
)
print("ledger_revoked_creds:", ledger_revoked_creds)
print(
"assert",
cred_exchange["indy"]["cred_rev_id"],
cred_exchange[_format]["cred_rev_id"],
"in",
ledger_revoked_creds["rev_reg_delta"]["value"]["revoked"],
)
assert (
int(cred_exchange["indy"]["cred_rev_id"])
int(cred_exchange[_format]["cred_rev_id"])
in ledger_revoked_creds["rev_reg_delta"]["value"]["revoked"]
)

Expand All @@ -265,8 +269,9 @@ def step_impl(context, holder):
agent["agent"], "/issue-credential-2.0/records/" + cred_ex_id
)
context.cred_exchange = cred_exchange
print("rev_reg_id:", cred_exchange["indy"]["rev_reg_id"])
print("cred_rev_id:", cred_exchange["indy"]["cred_rev_id"])
_format = "indy" if cred_exchange.get("indy") else "anoncreds"
print("rev_reg_id:", cred_exchange[_format]["rev_reg_id"])
print("cred_rev_id:", cred_exchange[_format]["cred_rev_id"])
print("connection_id:", cred_exchange["cred_ex_record"]["connection_id"])

# revoke the credential
Expand All @@ -275,8 +280,8 @@ def step_impl(context, holder):
agent["agent"],
"/revocation/revoke",
data={
"rev_reg_id": cred_exchange["indy"]["rev_reg_id"],
"cred_rev_id": cred_exchange["indy"]["cred_rev_id"],
"rev_reg_id": cred_exchange[_format]["rev_reg_id"],
"cred_rev_id": cred_exchange[_format]["cred_rev_id"],
"publish": "Y",
"connection_id": cred_exchange["cred_ex_record"]["connection_id"],
},
Expand All @@ -297,18 +302,21 @@ def step_impl(context, holder):

# get the required revocation info from the last credential exchange
cred_exchange = context.cred_exchange
print("rev_reg_id:", cred_exchange["indy"]["rev_reg_id"])
print("cred_rev_id:", cred_exchange["indy"]["cred_rev_id"])
_format = "indy" if cred_exchange.get("indy") else "anoncreds"
print("rev_reg_id:", cred_exchange[_format]["rev_reg_id"])
print("cred_rev_id:", cred_exchange[_format]["cred_rev_id"])
print("connection_id:", cred_exchange["cred_ex_record"]["connection_id"])

# check wallet status
wallet_revoked_creds = agent_container_GET(
agent["agent"],
"/revocation/registry/" + cred_exchange["indy"]["rev_reg_id"] + "/issued/details",
"/revocation/registry/"
+ cred_exchange[_format]["rev_reg_id"]
+ "/issued/details",
)
matched = False
for rec in wallet_revoked_creds:
if rec["cred_rev_id"] == cred_exchange["indy"]["cred_rev_id"]:
if rec["cred_rev_id"] == cred_exchange[_format]["cred_rev_id"]:
matched = True
assert rec["state"] == "revoked"
assert matched
Expand All @@ -317,12 +325,12 @@ def step_impl(context, holder):
ledger_revoked_creds = agent_container_GET(
agent["agent"],
"/revocation/registry/"
+ cred_exchange["indy"]["rev_reg_id"]
+ cred_exchange[_format]["rev_reg_id"]
+ "/issued/indy_recs",
)
print("ledger_revoked_creds:", ledger_revoked_creds)
assert (
int(cred_exchange["indy"]["cred_rev_id"])
int(cred_exchange[_format]["cred_rev_id"])
not in ledger_revoked_creds["rev_reg_delta"]["value"]["revoked"]
)

Expand Down
2 changes: 1 addition & 1 deletion demo/features/steps/0454-present-proof.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def step_impl(context, verifier, request_for_proof, prover):
proof_exchange = aries_container_request_proof(
agent["agent"],
proof_request_info,
agent["agent"].wallet_type == "askar-anoncreds",
is_anoncreds=agent["agent"].wallet_type == "askar-anoncreds",
)

context.proof_request = proof_request_info
Expand Down

0 comments on commit 3b25e7a

Please sign in to comment.