fix lndhub mypy issues
This commit is contained in:
parent
cc7c3807dd
commit
45acfb353d
|
@ -1,5 +1,4 @@
|
|||
from fastapi import Request
|
||||
from fastapi.params import Depends
|
||||
from fastapi import Depends, Request
|
||||
|
||||
from lnbits.core.models import User
|
||||
from lnbits.decorators import check_user_exists
|
||||
|
|
|
@ -1,15 +1,13 @@
|
|||
import asyncio
|
||||
import time
|
||||
from base64 import urlsafe_b64encode
|
||||
from http import HTTPStatus
|
||||
|
||||
from fastapi.param_functions import Query
|
||||
from fastapi.params import Depends
|
||||
from fastapi import Depends, Query
|
||||
from pydantic import BaseModel
|
||||
from starlette.exceptions import HTTPException
|
||||
|
||||
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.decorators import WalletTypeInfo
|
||||
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(...)
|
||||
|
||||
|
||||
@lndhub_ext.post("/ext/payinvoice")
|
||||
async def lndhub_payinvoice(
|
||||
r_invoice: Invoice, wallet: WalletTypeInfo = Depends(require_admin_key)
|
||||
r_invoice: CreateInvoice, wallet: WalletTypeInfo = Depends(require_admin_key)
|
||||
):
|
||||
try:
|
||||
await pay_invoice(
|
||||
|
|
|
@ -96,7 +96,6 @@ exclude = """(?x)(
|
|||
| ^lnbits/extensions/invoices.
|
||||
| ^lnbits/extensions/livestream.
|
||||
| ^lnbits/extensions/lnaddress.
|
||||
| ^lnbits/extensions/lndhub.
|
||||
| ^lnbits/extensions/lnurldevice.
|
||||
| ^lnbits/extensions/lnurlp.
|
||||
| ^lnbits/extensions/offlineshop.
|
||||
|
|
Loading…
Reference in New Issue
Block a user