remove update_payment_status/extra/details

This commit is contained in:
dni ⚡
2024-10-14 12:34:46 +02:00
parent 62d9470010
commit c77cb07915
7 changed files with 102 additions and 145 deletions
+5 -2
View File
@@ -20,8 +20,9 @@ from lnbits.core.crud import (
delete_account,
get_account,
get_account_by_username,
get_payment,
get_user,
update_payment_status,
update_payment,
)
from lnbits.core.models import Account, CreateInvoice, PaymentState, User
from lnbits.core.services import create_user_account, update_wallet_balance
@@ -250,7 +251,9 @@ async def fake_payments(client, adminkey_headers_from):
assert response.is_success
data = response.json()
assert data["checking_id"]
await update_payment_status(data["checking_id"], status=PaymentState.SUCCESS)
payment = await get_payment(data["checking_id"])
payment.status = PaymentState.SUCCESS
await update_payment(payment)
params = {"time[ge]": ts, "time[le]": time()}
return fake_data, params
+3 -2
View File
@@ -4,7 +4,7 @@ import hashlib
import pytest
from lnbits import bolt11
from lnbits.core.crud import get_standalone_payment, update_payment_details
from lnbits.core.crud import get_standalone_payment, update_payment
from lnbits.core.models import CreateInvoice, Payment, PaymentState
from lnbits.core.services import fee_reserve_total, get_balance_delta
from lnbits.tasks import create_task, wait_for_paid_invoices
@@ -303,7 +303,8 @@ async def test_receive_real_invoice_set_pending_and_check_state(
assert payment
# set the incoming invoice to pending
await update_payment_details(payment.checking_id, status=PaymentState.PENDING)
payment.status = PaymentState.PENDING
await update_payment(payment)
payment_pending = await get_standalone_payment(
invoice["payment_hash"], incoming=True