diff --git a/cashu/mint/crud.py b/cashu/mint/crud.py index 18a7195..a608967 100644 --- a/cashu/mint/crud.py +++ b/cashu/mint/crud.py @@ -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, + ), ) diff --git a/cashu/mint/ledger.py b/cashu/mint/ledger.py index 9b94261..522e54d 100644 --- a/cashu/mint/ledger.py +++ b/cashu/mint/ledger.py @@ -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): diff --git a/cashu/wallet/crud.py b/cashu/wallet/crud.py index 95dc464..bacb968 100644 --- a/cashu/wallet/crud.py +++ b/cashu/wallet/crud.py @@ -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, + ), )