Fix: Nut 05 mint response model (#564)

* change response model of NUT-05 to include payment_preimage and change (NUT-08)

* fix tests

* crud: same expiry as timestamp

* fix expiry handling

* add api tests to check new models
This commit is contained in:
callebtc
2024-06-27 14:35:03 +02:00
committed by GitHub
parent 8af1b61b30
commit 1d8b5cd5ca
12 changed files with 151 additions and 49 deletions

View File

@@ -357,11 +357,12 @@ async def test_melt_with_more_inputs_than_invoice(wallet1: Wallet, ledger: Ledge
# make sure we have more inputs than the melt quote needs
assert sum_proofs(wallet1.proofs) >= melt_quote.amount + melt_quote.fee_reserve
payment_proof, return_outputs = await ledger.melt(
melt_resp = await ledger.melt(
proofs=wallet1.proofs, quote=melt_quote.quote, outputs=outputs
)
# we get 2 sats back because we overpaid
assert sum([o.amount for o in return_outputs]) == 2
assert melt_resp.change
assert sum([o.amount for o in melt_resp.change]) == 2
@pytest.mark.asyncio