mirror of
https://github.com/aljazceru/nutshell.git
synced 2025-12-20 18:44:20 +01:00
fix return model for fastapi (#291)
This commit is contained in:
@@ -223,7 +223,7 @@ async def check_fees(payload: CheckFeesRequest) -> CheckFeesResponse:
|
|||||||
"/split",
|
"/split",
|
||||||
name="Split",
|
name="Split",
|
||||||
summary="Split proofs at a specified amount",
|
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.",
|
response_description="A list of blinded signatures that can be used to create proofs.",
|
||||||
)
|
)
|
||||||
async def split(
|
async def split(
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ async def invoice(ctx: Context, amount: int, hash: str, split: int):
|
|||||||
print(" Invoice paid.")
|
print(" Invoice paid.")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
# TODO: user error codes!
|
# TODO: user error codes!
|
||||||
if "invoice not paid" in str(e):
|
if "not paid" in str(e):
|
||||||
print(".", end="", flush=True)
|
print(".", end="", flush=True)
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ class LedgerAPI(object):
|
|||||||
"""
|
"""
|
||||||
resp_dict = resp.json()
|
resp_dict = resp.json()
|
||||||
if "detail" in resp_dict:
|
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']}"
|
error_message = f"Mint Error: {resp_dict['detail']}"
|
||||||
if "code" in resp_dict:
|
if "code" in resp_dict:
|
||||||
error_message += f" (Code: {resp_dict['code']})"
|
error_message += f" (Code: {resp_dict['code']})"
|
||||||
|
|||||||
Reference in New Issue
Block a user