mirror of
https://github.com/aljazceru/nutshell.git
synced 2026-02-04 00:04:20 +01:00
mypy
This commit is contained in:
@@ -93,7 +93,7 @@ async def get_lightning_invoice(
|
||||
SELECT * from invoices
|
||||
WHERE hash = ?
|
||||
""",
|
||||
hash,
|
||||
(hash,),
|
||||
)
|
||||
return Invoice.from_row(row)
|
||||
|
||||
@@ -106,5 +106,8 @@ async def update_lightning_invoice(
|
||||
):
|
||||
await (conn or db).execute(
|
||||
"UPDATE invoices SET issued = ? WHERE hash = ?",
|
||||
(issued, hash),
|
||||
(
|
||||
issued,
|
||||
hash,
|
||||
),
|
||||
)
|
||||
|
||||
@@ -30,9 +30,9 @@ class Ledger:
|
||||
def __init__(self, secret_key: str, db: str):
|
||||
self.proofs_used: Set[str] = set()
|
||||
|
||||
self.master_key: str = secret_key
|
||||
self.keys: List[PrivateKey] = self._derive_keys(self.master_key)
|
||||
self.pub_keys: List[PublicKey] = self._derive_pubkeys(self.keys)
|
||||
self.master_key = secret_key
|
||||
self.keys = self._derive_keys(self.master_key)
|
||||
self.pub_keys = self._derive_pubkeys(self.keys)
|
||||
self.db: Database = Database("mint", db)
|
||||
|
||||
async def load_used_proofs(self):
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import time
|
||||
from typing import Optional, List
|
||||
from typing import Optional, List, Any
|
||||
|
||||
from cashu.core.base import Proof, P2SHScript
|
||||
from cashu.core.db import Connection, Database
|
||||
@@ -59,7 +59,7 @@ async def invalidate_proof(
|
||||
DELETE FROM proofs
|
||||
WHERE secret = ?
|
||||
""",
|
||||
str(proof["secret"]),
|
||||
(str(proof["secret"]),),
|
||||
)
|
||||
|
||||
await (conn or db).execute(
|
||||
@@ -80,7 +80,7 @@ async def update_proof_reserved(
|
||||
conn: Optional[Connection] = None,
|
||||
):
|
||||
clauses = []
|
||||
values = []
|
||||
values: List[Any] = []
|
||||
clauses.append("reserved = ?")
|
||||
values.append(reserved)
|
||||
|
||||
@@ -110,7 +110,7 @@ async def secret_used(
|
||||
SELECT * from proofs
|
||||
WHERE secret = ?
|
||||
""",
|
||||
(secret),
|
||||
(secret,),
|
||||
)
|
||||
return rows is not None
|
||||
|
||||
@@ -127,7 +127,12 @@ async def store_p2sh(
|
||||
(address, script, signature, used)
|
||||
VALUES (?, ?, ?, ?)
|
||||
""",
|
||||
(p2sh.address, p2sh.script, p2sh.signature, False),
|
||||
(
|
||||
p2sh.address,
|
||||
p2sh.script,
|
||||
p2sh.signature,
|
||||
False,
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user