mypy fixes, api, eclair

This commit is contained in:
dni
2022-07-20 10:05:30 +02:00
parent 704b572349
commit 25d19244be
2 changed files with 4 additions and 3 deletions

View File

@ -181,7 +181,7 @@ async def api_payments_create_invoice(data: CreateInvoiceData, wallet: Wallet):
lnurl_response: Union[None, bool, str] = None lnurl_response: Union[None, bool, str] = None
if data.lnurl_callback: if data.lnurl_callback:
if "lnurl_balance_check" in data: if hasattr(data, "lnurl_balance_check"):
assert ( assert (
data.lnurl_balance_check is not None data.lnurl_balance_check is not None
), "lnurl_balance_check is required" ), "lnurl_balance_check is required"
@ -248,7 +248,7 @@ async def api_payments_pay_invoice(bolt11: str, wallet: Wallet):
) )
async def api_payments_create( async def api_payments_create(
wallet: WalletTypeInfo = Depends(require_invoice_key), wallet: WalletTypeInfo = Depends(require_invoice_key),
invoiceData: CreateInvoiceData = Body(...), invoiceData = Body(...),
): ):
if invoiceData.out is True and wallet.wallet_type == 0: if invoiceData.out is True and wallet.wallet_type == 0:
if not invoiceData.bolt11: if not invoiceData.bolt11:

View File

@ -9,7 +9,8 @@ import httpx
from loguru import logger from loguru import logger
# mypy https://github.com/aaugustin/websockets/issues/940 # mypy https://github.com/aaugustin/websockets/issues/940
from websockets.client import connect # from websockets.client import connect
from websockets import connect
from websockets.exceptions import ( from websockets.exceptions import (
ConnectionClosed, ConnectionClosed,
ConnectionClosedError, ConnectionClosedError,