Skip to content

Commit

Permalink
remove one bridge assumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
mvadari committed Aug 18, 2023
1 parent ab4ee27 commit 4f52b98
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
16 changes: 8 additions & 8 deletions xbridge_cli/bridge/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,10 +338,10 @@ def setup_bridge(
raise XBridgeCLIException(obj_error)
locking_door_objs = locking_objs_result["account_objects"]
if len(locking_door_objs) > 0:
assert (
len(locking_door_objs) == 1
), "Cannot have multiple bridges on one account"
if XChainBridge.from_xrpl(locking_door_objs[0]["XChainBridge"]) == bridge_obj:
if any(
XChainBridge.from_xrpl(obj["XChainBridge"]) == bridge_obj
for obj in locking_door_objs
):
locking_bridge_exists = True
else:
raise XBridgeCLIException(
Expand Down Expand Up @@ -457,10 +457,10 @@ def setup_bridge(
raise XBridgeCLIException(obj_error)
issuing_door_objs = issuing_objs_result["account_objects"]
if len(issuing_door_objs) > 0:
assert (
len(issuing_door_objs) == 1
), "Cannot have multiple bridges on one account"
if XChainBridge.from_xrpl(issuing_door_objs[0]["XChainBridge"]) == bridge_obj:
if any(
XChainBridge.from_xrpl(obj["XChainBridge"]) == bridge_obj
for obj in issuing_door_objs
):
issuing_bridge_exists = True
else:
raise XBridgeCLIException(
Expand Down
1 change: 0 additions & 1 deletion xbridge_cli/bridge/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def _get_bridge(client: JsonRpcClient, door_account: str) -> Dict[str, Any]:
# TODO: filter by bridge when that's implemented
objects = _get_account_objects(client, door_account)
bridge_objects = [obj for obj in objects if obj["LedgerEntryType"] == "Bridge"]
assert len(bridge_objects) == 1
return bridge_objects[0]


Expand Down

0 comments on commit 4f52b98

Please sign in to comment.