mypy fixes.

This commit is contained in:
fiatjaf
2020-10-13 14:46:23 -03:00
parent cf0bd7ece8
commit bcdc065cc0
6 changed files with 13 additions and 16 deletions
+3 -6
View File
@@ -1,7 +1,7 @@
import httpx
from typing import Optional, Tuple, Dict
from quart import g
from lnurl import LnurlWithdrawResponse
from lnurl import LnurlWithdrawResponse # type: ignore
try:
from typing import TypedDict # type: ignore
@@ -116,7 +116,7 @@ def pay_invoice(
else:
# actually pay the external invoice
payment: PaymentResponse = WALLET.pay_invoice(payment_request)
if payment.ok:
if payment.ok and payment.checking_id:
create_payment(
checking_id=payment.checking_id,
fee=payment.fee_msat,
@@ -132,13 +132,10 @@ def pay_invoice(
async def redeem_lnurl_withdraw(wallet_id: str, res: LnurlWithdrawResponse, memo: Optional[str] = None) -> None:
if not memo:
memo = res.default_description
_, payment_request = create_invoice(
wallet_id=wallet_id,
amount=res.max_sats,
memo=memo,
memo=memo or res.default_description or "",
extra={"tag": "lnurlwallet"},
)