fix: add-invoice crash and update docs

A required field was not set and for some reason prior Pydantic versions
didn't notice at all.

closes #150
This commit is contained in:
fusion44 2022-09-11 19:33:46 +02:00
parent 4408a6a58c
commit a4e9f7bf23
No known key found for this signature in database
2 changed files with 7 additions and 1 deletions

View file

@ -421,6 +421,7 @@ async def add_invoice_impl(
# Can't use Invoice.from_lnd_grpc() here because
# the response is not a standard invoice
invoice = Invoice(
value_msat=value_msat,
memo=memo,
expiry=expiry,
r_hash=response.r_hash.hex(),

View file

@ -69,7 +69,12 @@ responses = {
responses=responses,
)
async def addinvoice(
value_msat: int, memo: str = "", expiry: int = 3600, is_keysend: bool = False
value_msat: int = Query(description="The amount of msat of the invoice", ge=0),
memo: str = Query("", description="The memo of the invoice"),
expiry: int = Query(3600, description="Expiry time in seconds"),
is_keysend: bool = Query(
False, description="LND only: Whether this invoice is a keysend invoice."
),
):
try:
return await add_invoice(memo, value_msat, expiry, is_keysend)