Skip to content

Commit

Permalink
Addm ore debug logs to IBC transfers.
Browse files Browse the repository at this point in the history
  • Loading branch information
dowlandaiello committed Oct 14, 2024
1 parent 70b020c commit f1cf81a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/strategies/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
try_multiple_clients_fatal,
try_multiple_clients,
DenomRouteQuery,
fmt_denom_route_leg,
)
from src.scheduler import Ctx
from cosmos.base.v1beta1 import coin_pb2
Expand Down Expand Up @@ -963,6 +964,13 @@ async def transfer(
)
)

ctx.log_route(
route,
"info",
"Got potential transfer route: %s",
[fmt_denom_route_leg(leg) for leg in ibc_route],
)

if not ibc_route or len(ibc_route) == 0:
raise ValueError(f"No route from {denom} to {leg.backend.chain_id}")

Expand Down
6 changes: 6 additions & 0 deletions src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,12 @@ def load_denom_route_leg(obj: dict[str, Any]) -> DenomRouteLeg:
)


def fmt_denom_route_leg(leg: DenomRouteLeg) -> str:
return (
f"{src_denom} ({src_chain}) -> {dest_denom} ({dest_chain}) via {channel}/{port}"
)


@dataclass
class DenomChainInfo:
"""
Expand Down

0 comments on commit f1cf81a

Please sign in to comment.