Mint: lookup internal quote settlement by request (#478)

This commit is contained in:
callebtc
2024-03-16 17:14:50 +01:00
committed by GitHub
parent e7b1e0c0ed
commit 86b8f5811f
3 changed files with 28 additions and 12 deletions

View File

@@ -46,6 +46,22 @@ async def test_mint_quote(wallet1: Wallet, ledger: Ledger):
assert quote.created_time
@pytest.mark.asyncio
async def test_get_mint_quote_by_request(wallet1: Wallet, ledger: Ledger):
invoice = await wallet1.request_mint(128)
assert invoice is not None
quote = await ledger.crud.get_mint_quote_by_request(
request=invoice.bolt11, db=ledger.db
)
assert quote is not None
assert quote.quote == invoice.id
assert quote.amount == 128
assert quote.unit == "sat"
assert not quote.paid
assert quote.paid_time is None
assert quote.created_time
@pytest.mark.asyncio
async def test_melt_quote(wallet1: Wallet, ledger: Ledger):
invoice = await wallet1.request_mint(128)