Skip to content

Commit

Permalink
fix integer indexing of row fields
Browse files Browse the repository at this point in the history
  • Loading branch information
lollerfirst committed Oct 3, 2024
1 parent 130abae commit a152df2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion cashu/mint/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,10 @@ async def get_balance(
"""
)
assert row, "Balance not found"
return int(row[0])

# Thank SQLAlchemy for this!
key = next(iter(row))
return int(row[key])

async def get_keyset(
self,
Expand Down
6 changes: 3 additions & 3 deletions cashu/wallet/crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ async def bump_secret_derivation(
)
counter = 0
else:
counter = int(rows[0])
counter = int(rows["counter"])

if not skip:
await (conn or db).execute(
Expand Down Expand Up @@ -437,8 +437,8 @@ async def get_seed_and_mnemonic(
)
return (
(
row[0],
row[1],
row["seed"],
row["mnemonic"],
)
if row
else None
Expand Down

0 comments on commit a152df2

Please sign in to comment.