[TEST] proper credit_wallet function from services (#1862)

This commit is contained in:
dni ⚡ 2023-08-07 21:49:37 +02:00 committed by GitHub
parent 03acf5e5ec
commit f096b51f70
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 27 deletions

View file

@ -8,15 +8,11 @@ from httpx import AsyncClient
from lnbits.app import create_app
from lnbits.commands import migrate_databases
from lnbits.core.crud import create_account, create_wallet
from lnbits.core.services import update_wallet_balance
from lnbits.core.views.api import CreateInvoiceData, api_payments_create_invoice
from lnbits.db import Database
from lnbits.settings import settings
from tests.helpers import (
credit_wallet,
get_hold_invoice,
get_random_invoice_data,
get_real_invoice,
)
from tests.helpers import get_hold_invoice, get_random_invoice_data, get_real_invoice
@pytest_asyncio.fixture(scope="session")
@ -68,7 +64,7 @@ async def from_user():
async def from_wallet(from_user):
user = from_user
wallet = await create_wallet(user_id=user.id, wallet_name="test_wallet_from")
await credit_wallet(
await update_wallet_balance(
wallet_id=wallet.id,
amount=999999999,
)
@ -91,7 +87,7 @@ async def to_user():
async def to_wallet(to_user):
user = to_user
wallet = await create_wallet(user_id=user.id, wallet_name="test_wallet_to")
await credit_wallet(
await update_wallet_balance(
wallet_id=wallet.id,
amount=999999999,
)