Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Repair release bdd tests #3376

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading