From 4c1ff8b35332131fb13522a6963b45f89db8be20 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Wed, 26 Jul 2023 10:50:58 +0200 Subject: [PATCH] fix return model for fastapi (#291) --- cashu/mint/router.py | 2 +- cashu/wallet/cli/cli.py | 2 +- cashu/wallet/wallet.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cashu/mint/router.py b/cashu/mint/router.py index afeb6752..526faf8e 100644 --- a/cashu/mint/router.py +++ b/cashu/mint/router.py @@ -223,7 +223,7 @@ async def check_fees(payload: CheckFeesRequest) -> CheckFeesResponse: "/split", name="Split", summary="Split proofs at a specified amount", - response_model=PostSplitResponse, + response_model=Union[PostSplitResponse, PostSplitResponse_Deprecated], response_description="A list of blinded signatures that can be used to create proofs.", ) async def split( diff --git a/cashu/wallet/cli/cli.py b/cashu/wallet/cli/cli.py index a5825787..b6460b91 100644 --- a/cashu/wallet/cli/cli.py +++ b/cashu/wallet/cli/cli.py @@ -220,7 +220,7 @@ async def invoice(ctx: Context, amount: int, hash: str, split: int): print(" Invoice paid.") except Exception as e: # TODO: user error codes! - if "invoice not paid" in str(e): + if "not paid" in str(e): print(".", end="", flush=True) continue else: diff --git a/cashu/wallet/wallet.py b/cashu/wallet/wallet.py index 7723ca3b..da0992a7 100644 --- a/cashu/wallet/wallet.py +++ b/cashu/wallet/wallet.py @@ -237,7 +237,7 @@ def raise_on_error(resp: Response) -> None: """ resp_dict = resp.json() if "detail" in resp_dict: - logger.error(f"Error from mint: {resp_dict}") + logger.trace(f"Error from mint: {resp_dict}") error_message = f"Mint Error: {resp_dict['detail']}" if "code" in resp_dict: error_message += f" (Code: {resp_dict['code']})"