fix many mypy complaints, specially on bolt11.py

This commit is contained in:
fiatjaf
2020-09-02 22:21:56 -03:00
parent ce28db76c9
commit dc3d96c6a8
5 changed files with 99 additions and 96 deletions
+2 -2
View File
@@ -276,10 +276,10 @@ def delete_payment(checking_id: str) -> None:
db.execute("DELETE FROM apipayments WHERE checking_id = ?", (checking_id,))
def check_internal(payment_hash: str) -> None:
def check_internal(payment_hash: str) -> Optional[str]:
with open_db() as db:
row = db.fetchone("SELECT checking_id FROM apipayments WHERE hash = ?", (payment_hash,))
if not row:
return False
return None
else:
return row["checking_id"]