Skip to content

Commit cbf53d3

Browse files
authored
🐛 Fix unchanged endpoint being rewritten to ledger (openwallet-foundation#3608)
Resolves openwallet-foundation#3607 Signed-off-by: ff137 <ff137@proton.me>
1 parent 76ac265 commit cbf53d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

acapy_agent/ledger/indy_vdr.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -731,6 +731,7 @@ async def update_endpoint_for_did(
731731
endorser_did: DID of the endorser to use for the transaction
732732
routing_keys: List of routing keys
733733
"""
734+
routing_keys = routing_keys or [] # Ensure list type if None was passed
734735
public_info = await self.get_wallet_public_did()
735736
if not public_info:
736737
raise BadLedgerRequestError(
@@ -749,8 +750,13 @@ async def update_endpoint_for_did(
749750
existing_routing_keys = (
750751
all_exist_endpoints.get("routingKeys") if all_exist_endpoints else None
751752
)
753+
existing_routing_keys = existing_routing_keys or []
752754

753-
if exist_endpoint_of_type != endpoint or existing_routing_keys != routing_keys:
755+
endpoint_changed = exist_endpoint_of_type != endpoint
756+
routing_keys_changed = set(existing_routing_keys) != set(routing_keys)
757+
758+
if endpoint_changed or routing_keys_changed:
759+
LOGGER.info("Endpoint or routing keys have changed, updating endpoint")
754760
if self.read_only:
755761
raise LedgerError(
756762
"Error cannot update endpoint when ledger is in read only mode"

0 commit comments

Comments
 (0)