Skip to content

Commit

Permalink
Integration tests - Add retry to did registration
Browse files Browse the repository at this point in the history
Signed-off-by: jamshale <[email protected]>
  • Loading branch information
jamshale committed Mar 6, 2024
1 parent fa2a8ea commit e470169
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions demo/features/steps/0586-sign-transaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,27 @@ def step_impl(context, agent_name, did_role):
created_did = agent_container_POST(agent["agent"], "/wallet/did/create")

# publish to the ledger with did_role
registered_did = agent_container_register_did(
agent_container_register_did(
agent["agent"],
created_did["result"]["did"],
created_did["result"]["verkey"],
"ENDORSER" if did_role == "ENDORSER" else "",
)

# make the new did the wallet's public did
published_did = agent_container_POST(
agent["agent"],
"/wallet/did/public",
params={"did": created_did["result"]["did"]},
)
retries = 3
for retry in range(retries):
try:
published_did = agent_container_POST(
agent["agent"],
"/wallet/did/public",
params={"did": created_did["result"]["did"]},
)
except Exception as e:
async_sleep(1.0)
if retry == retries - 1:
raise e

if "result" in published_did:
# published right away!
pass
Expand Down

0 comments on commit e470169

Please sign in to comment.