File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff 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"
You can’t perform that action at this time.
0 commit comments