Remove redundant wallet initialization

This commit is contained in:
shroominic
2025-06-06 12:06:51 +02:00
parent d073f487c6
commit 495dc6b53f
4 changed files with 9 additions and 3 deletions
+4 -2
View File
@@ -71,8 +71,10 @@ async def validate_bearer_key(
key_expiry_time=key_expiry_time,
)
await credit_balance(
bearer_key, new_key, session
) # TODO: see cashu.py "_initialize_wallet"
bearer_key,
new_key,
session,
)
await session.refresh(new_key)
return new_key
except Exception as e:
+2
View File
@@ -25,6 +25,8 @@ async def close_wallet():
global WALLET
await WALLET.aclose()
async def pay_out() -> None:
"""
Calculates the pay-out amount based on the spent balance, profit, and donation rate.
+2
View File
@@ -203,3 +203,5 @@ async def test_account_with_cashu_token(
# Check that a new key was created with the hashed token
assert data["api_key"].startswith("sk-")
assert data["balance"] >= 0 # Balance should be set after credit_balance
+1 -1
View File
@@ -56,4 +56,4 @@ async def test_startup_event_initializes_properly(test_client):
# The test_client fixture already triggers the startup event
# This test ensures no exceptions are raised during startup
response = test_client.get("/")
assert response.status_code == 200
assert response.status_code == 200