Skip to content

Commit

Permalink
node_info safe return
Browse files Browse the repository at this point in the history
  • Loading branch information
jeandemeusy committed Nov 19, 2024
1 parent 0304f6f commit 0e28dea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ct-app/core/components/hoprd_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ async def messages_pop_all(self, tag: int = MESSAGE_TAG) -> list:
)
return response.get("messages", []) if is_ok else []

async def node_info(self) -> Infos:
_, response = await self.__call_api(Method.GET, "node/info")
return Infos(response)
async def node_info(self) -> Optional[Infos]:
is_ok, response = await self.__call_api(Method.GET, "node/info")
return Infos(response) if is_ok else None

async def ticket_price(self) -> Optional[TicketPrice]:
is_ok, response = await self.__call_api(Method.GET, "network/price")
Expand Down

0 comments on commit 0e28dea

Please sign in to comment.