mirror of
https://github.com/Routstr/routstr-core.git
synced 2026-08-09 11:04:36 +00:00
Remove redundant wallet initialization
This commit is contained in:
+4
-2
@@ -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:
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user