remove boltz

This commit is contained in:
dni ⚡ 2023-02-15 10:06:21 +01:00
parent 891227b279
commit 7baa248204
No known key found for this signature in database
GPG key ID: 886317704CC4E618
26 changed files with 0 additions and 2584 deletions

View file

@ -1,14 +0,0 @@
import pytest_asyncio
from lnbits.extensions.boltz.models import CreateReverseSubmarineSwap
@pytest_asyncio.fixture(scope="session")
async def reverse_swap(from_wallet):
data = CreateReverseSubmarineSwap(
wallet=from_wallet.id,
instant_settlement=True,
onchain_address="bcrt1q4vfyszl4p8cuvqh07fyhtxve5fxq8e2ux5gx43",
amount=20_000,
)
return data

View file

@ -1,102 +0,0 @@
import pytest
from tests.helpers import is_fake
@pytest.mark.asyncio
@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest")
async def test_mempool_url(client):
response = await client.get("/boltz/api/v1/swap/mempool")
assert response.status_code == 200
@pytest.mark.asyncio
@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest")
async def test_boltz_config(client):
response = await client.get("/boltz/api/v1/swap/boltz")
assert response.status_code == 200
@pytest.mark.asyncio
@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest")
async def test_endpoints_unauthenticated(client):
response = await client.get("/boltz/api/v1/swap?all_wallets=true")
assert response.status_code == 401
response = await client.get("/boltz/api/v1/swap/reverse?all_wallets=true")
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap")
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap/reverse")
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap/status")
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap/check")
assert response.status_code == 401
@pytest.mark.asyncio
@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest")
async def test_endpoints_inkey(client, inkey_headers_to):
response = await client.get(
"/boltz/api/v1/swap?all_wallets=true", headers=inkey_headers_to
)
assert response.status_code == 200
response = await client.get(
"/boltz/api/v1/swap/reverse?all_wallets=true", headers=inkey_headers_to
)
assert response.status_code == 200
response = await client.post("/boltz/api/v1/swap", headers=inkey_headers_to)
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap/reverse", headers=inkey_headers_to)
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap/refund", headers=inkey_headers_to)
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap/status", headers=inkey_headers_to)
assert response.status_code == 401
response = await client.post("/boltz/api/v1/swap/check", headers=inkey_headers_to)
assert response.status_code == 401
@pytest.mark.asyncio
@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest")
async def test_endpoints_adminkey_badrequest(client, adminkey_headers_to):
response = await client.post("/boltz/api/v1/swap", headers=adminkey_headers_to)
assert response.status_code == 400
response = await client.post(
"/boltz/api/v1/swap/reverse", headers=adminkey_headers_to
)
assert response.status_code == 400
response = await client.post(
"/boltz/api/v1/swap/refund", headers=adminkey_headers_to
)
assert response.status_code == 400
response = await client.post(
"/boltz/api/v1/swap/status", headers=adminkey_headers_to
)
assert response.status_code == 400
@pytest.mark.asyncio
@pytest.mark.skipif(is_fake, reason="this test is only passes with regtest")
async def test_endpoints_adminkey_regtest(client, from_wallet, adminkey_headers_to):
swap = {
"wallet": from_wallet.id,
"refund_address": "bcrt1q3cwq33y435h52gq3qqsdtczh38ltlnf69zvypm",
"amount": 50_000,
}
response = await client.post(
"/boltz/api/v1/swap", json=swap, headers=adminkey_headers_to
)
assert response.status_code == 201
reverse_swap = {
"wallet": from_wallet.id,
"instant_settlement": True,
"onchain_address": "bcrt1q4vfyszl4p8cuvqh07fyhtxve5fxq8e2ux5gx43",
"amount": 50_000,
}
response = await client.post(
"/boltz/api/v1/swap/reverse", json=reverse_swap, headers=adminkey_headers_to
)
assert response.status_code == 201