Ngutech21-fix-get-quote-api (#397)

* fix: v1 mint-quote api in router

* fix get mint quote

* test new endpoints

---------

Co-authored-by: ngutech21 <ngutech21@pm.me>
This commit is contained in:
callebtc
2024-01-24 22:02:25 +01:00
committed by GitHub
parent 2645eb51bc
commit b307c4db79
2 changed files with 22 additions and 6 deletions

View File

@@ -183,6 +183,14 @@ async def test_mint_quote(ledger: Ledger):
invoice = bolt11.decode(result["request"])
assert invoice.amount_msat == 100 * 1000
# get mint quote again from api
response = httpx.get(
f"{BASE_URL}/v1/mint/quote/bolt11/{result['quote']}",
)
assert response.status_code == 200, f"{response.url} {response.status_code}"
result2 = response.json()
assert result2["quote"] == result["quote"]
@pytest.mark.asyncio
@pytest.mark.skipif(
@@ -236,6 +244,14 @@ async def test_melt_quote_internal(ledger: Ledger, wallet: Wallet):
# TODO: internal invoice, fee should be 0
assert result["fee_reserve"] == 0
# get melt quote again from api
response = httpx.get(
f"{BASE_URL}/v1/melt/quote/bolt11/{result['quote']}",
)
assert response.status_code == 200, f"{response.url} {response.status_code}"
result2 = response.json()
assert result2["quote"] == result["quote"]
@pytest.mark.asyncio
@pytest.mark.skipif(