From f1cf81a208d803d8b88d983be5599381a6274070 Mon Sep 17 00:00:00 2001 From: Dowland Aiello Date: Mon, 14 Oct 2024 21:00:14 +0000 Subject: [PATCH] Addm ore debug logs to IBC transfers. --- src/strategies/util.py | 8 ++++++++ src/util.py | 6 ++++++ 2 files changed, 14 insertions(+) diff --git a/src/strategies/util.py b/src/strategies/util.py index 602c80f5..13c6c4fc 100644 --- a/src/strategies/util.py +++ b/src/strategies/util.py @@ -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 @@ -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}") diff --git a/src/util.py b/src/util.py index b9805c4c..1f6f442a 100644 --- a/src/util.py +++ b/src/util.py @@ -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: """