From 32461b7eb9a88b34c4f580a96fc19978285735a2 Mon Sep 17 00:00:00 2001 From: callebtc <93376500+callebtc@users.noreply.github.com> Date: Fri, 5 Jan 2024 17:00:42 +0100 Subject: [PATCH] fix db lookup --- .github/workflows/ci.yml | 4 ++-- cashu/mint/crud.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 182d50ae..873fce80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,8 @@ jobs: os: [ubuntu-latest] python-version: ["3.10"] poetry-version: ["1.7.1"] - mint-cache-secrets: ["true", "false"] - mint-only-deprecated: ["true", "false"] + mint-cache-secrets: ["false", "true"] + mint-only-deprecated: ["false", "true"] # db-url: ["", "postgres://cashu:cashu@localhost:5432/test"] # TODO: Postgres test not working db-url: [""] backend-wallet-class: ["FakeWallet"] diff --git a/cashu/mint/crud.py b/cashu/mint/crud.py index 9db350d2..2d9660a3 100644 --- a/cashu/mint/crud.py +++ b/cashu/mint/crud.py @@ -40,6 +40,7 @@ async def get_spent_proofs( async def get_proof_used( self, + *, db: Database, secret: str, conn: Optional[Connection] = None, @@ -583,7 +584,7 @@ async def get_proof_used( ) -> Optional[Proof]: row = await (conn or db).fetchone( f""" - SELECT 1 from {table_with_schema(db, 'proofs_used')} + SELECT * from {table_with_schema(db, 'proofs_used')} WHERE secret = ? """, (secret,),