Skip to content

Commit 9559dee

Browse files
author
Yuki I
committed
refactor: clean up code mess
Signed-off-by: Yuki I <[email protected]>
1 parent 273a8df commit 9559dee

File tree

1 file changed

+12
-20
lines changed

1 file changed

+12
-20
lines changed

acapy_agent/ledger/indy_vdr.py

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ async def _submit(
312312
taa_accept: Optional[bool] = None,
313313
sign_did: DIDInfo = sentinel,
314314
write_ledger: bool = True,
315-
profile: Optional[Profile] = None, # <-- ADD profile parameter
315+
profile: Optional[Profile] = None,
316316
) -> dict:
317317
"""Sign and submit request to ledger.
318318
@@ -1170,7 +1170,6 @@ async def send_revoc_reg_def(
11701170
did_info = await wallet.get_local_did(issuer_did)
11711171
else:
11721172
did_info = await wallet.get_public_did()
1173-
del wallet
11741173
if not did_info:
11751174
raise LedgerTransactionError(
11761175
"No issuer DID found for revocation registry definition"
@@ -1262,13 +1261,9 @@ async def send_revoc_reg_entry(
12621261

12631262
wallet_type = current_profile.context.settings.get("wallet.type")
12641263
if wallet_type == "askar-anoncreds":
1265-
try:
1266-
from acapy_agent.anoncreds.default.legacy_indy.registry import (
1267-
LegacyIndyRegistry,
1268-
)
1269-
1270-
except ImportError:
1271-
raise
1264+
from acapy_agent.anoncreds.default.legacy_indy.registry import (
1265+
LegacyIndyRegistry,
1266+
)
12721267

12731268
revoc_reg_entry_req = await self._create_revoc_reg_entry_request(
12741269
did_info,
@@ -1283,17 +1278,14 @@ async def send_revoc_reg_entry(
12831278
revoc_reg_entry_req.set_endorser(endorser_did)
12841279

12851280
legacy_indy_registry = LegacyIndyRegistry()
1286-
try:
1287-
resp = await legacy_indy_registry.txn_submit(
1288-
self,
1289-
revoc_reg_entry_req,
1290-
sign=True,
1291-
sign_did=did_info,
1292-
write_ledger=write_ledger,
1293-
profile=current_profile,
1294-
)
1295-
except Exception:
1296-
raise
1281+
resp = await legacy_indy_registry.txn_submit(
1282+
self,
1283+
revoc_reg_entry_req,
1284+
sign=True,
1285+
sign_did=did_info,
1286+
write_ledger=write_ledger,
1287+
profile=current_profile,
1288+
)
12971289

12981290
if not write_ledger:
12991291
return revoc_reg_id, {"signed_txn": resp}

0 commit comments

Comments
 (0)