fix lndhub mypy issues

This commit is contained in:
dni ⚡ 2023-01-04 14:01:18 +01:00
parent cc7c3807dd
commit 45acfb353d
3 changed files with 5 additions and 9 deletions

View File

@ -1,5 +1,4 @@
from fastapi import Request from fastapi import Depends, Request
from fastapi.params import Depends
from lnbits.core.models import User from lnbits.core.models import User
from lnbits.decorators import check_user_exists from lnbits.decorators import check_user_exists

View File

@ -1,15 +1,13 @@
import asyncio
import time import time
from base64 import urlsafe_b64encode from base64 import urlsafe_b64encode
from http import HTTPStatus from http import HTTPStatus
from fastapi.param_functions import Query from fastapi import Depends, Query
from fastapi.params import Depends
from pydantic import BaseModel from pydantic import BaseModel
from starlette.exceptions import HTTPException from starlette.exceptions import HTTPException
from lnbits import bolt11 from lnbits import bolt11
from lnbits.core.crud import delete_expired_invoices, get_payments from lnbits.core.crud import get_payments
from lnbits.core.services import create_invoice, pay_invoice from lnbits.core.services import create_invoice, pay_invoice
from lnbits.decorators import WalletTypeInfo from lnbits.decorators import WalletTypeInfo
from lnbits.settings import get_wallet_class, settings from lnbits.settings import get_wallet_class, settings
@ -73,13 +71,13 @@ async def lndhub_addinvoice(
} }
class Invoice(BaseModel): class CreateInvoice(BaseModel):
invoice: str = Query(...) invoice: str = Query(...)
@lndhub_ext.post("/ext/payinvoice") @lndhub_ext.post("/ext/payinvoice")
async def lndhub_payinvoice( async def lndhub_payinvoice(
r_invoice: Invoice, wallet: WalletTypeInfo = Depends(require_admin_key) r_invoice: CreateInvoice, wallet: WalletTypeInfo = Depends(require_admin_key)
): ):
try: try:
await pay_invoice( await pay_invoice(

View File

@ -96,7 +96,6 @@ exclude = """(?x)(
| ^lnbits/extensions/invoices. | ^lnbits/extensions/invoices.
| ^lnbits/extensions/livestream. | ^lnbits/extensions/livestream.
| ^lnbits/extensions/lnaddress. | ^lnbits/extensions/lnaddress.
| ^lnbits/extensions/lndhub.
| ^lnbits/extensions/lnurldevice. | ^lnbits/extensions/lnurldevice.
| ^lnbits/extensions/lnurlp. | ^lnbits/extensions/lnurlp.
| ^lnbits/extensions/offlineshop. | ^lnbits/extensions/offlineshop.