[BUG] self payments for the same wallet (#1914)
* [BUG] self payments for fakewallet make it possible to pay to yourself on fakewallet f * bugfix selfpayments for fakewallet * delete by wallet and fix previous_payment check (#1919) --------- Co-authored-by: callebtc <93376500+callebtc@users.noreply.github.com>
This commit is contained in:
parent
a97f298586
commit
f19d59d429
3 changed files with 27 additions and 10 deletions
|
|
@ -209,6 +209,24 @@ async def test_pay_invoice_wrong_key(client, invoice, adminkey_headers_from):
|
|||
assert response.status_code >= 300 # should fail
|
||||
|
||||
|
||||
# check POST /api/v1/payments: payment with self payment
|
||||
@pytest.mark.asyncio
|
||||
async def test_pay_invoice_self_payment(client, adminkey_headers_from):
|
||||
create_invoice = CreateInvoice(out=False, amount=1000, memo="test")
|
||||
response = await client.post(
|
||||
"/api/v1/payments",
|
||||
json=create_invoice.dict(),
|
||||
headers=adminkey_headers_from,
|
||||
)
|
||||
assert response.status_code < 300
|
||||
json_data = response.json()
|
||||
data = {"out": True, "bolt11": json_data["payment_request"]}
|
||||
response = await client.post(
|
||||
"/api/v1/payments", json=data, headers=adminkey_headers_from
|
||||
)
|
||||
assert response.status_code < 300
|
||||
|
||||
|
||||
# check POST /api/v1/payments: payment with invoice key [should fail]
|
||||
@pytest.mark.asyncio
|
||||
async def test_pay_invoice_invoicekey(client, invoice, inkey_headers_from):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue