Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Dec 2, 2023
1 parent 1ed7858 commit f5ced37
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
9 changes: 4 additions & 5 deletions tests/test_mint_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ async def test_melt_internal(ledger: Ledger, wallet: Wallet):
invoice_payment_request = invoice.bolt11

quote = await wallet.melt_quote(invoice_payment_request)
inputs_payload = [p.to_dict() for p in wallet.proofs]
keep, send = await wallet.split_to_send(wallet.proofs, 62)
inputs_payload = [p.to_dict() for p in send]

assert quote.amount == 62
assert quote.fee_reserve == 0
Expand All @@ -299,9 +300,6 @@ async def test_melt_internal(ledger: Ledger, wallet: Wallet):
result = response.json()
assert result.get("proof") is not None
assert result["paid"] is True
assert result["change"]
# we get back 2 sats because we provided the entire wallet balance which was 64 sats
assert result["change"][0]["amount"] == 2


@pytest.mark.asyncio
Expand All @@ -324,7 +322,8 @@ async def test_melt_external(ledger: Ledger, wallet: Wallet):
invoice_payment_request = invoice_dict["payment_request"]

quote = await wallet.melt_quote(invoice_payment_request)
inputs_payload = [p.to_dict() for p in wallet.proofs]
keep, send = await wallet.split_to_send(wallet.proofs, 62)
inputs_payload = [p.to_dict() for p in send]

assert quote.amount == 62
assert quote.fee_reserve == 2
Expand Down
6 changes: 2 additions & 4 deletions tests/test_mint_api_deprecated.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ async def test_melt(ledger: Ledger, wallet: Wallet):
str(invoice_dict["r_hash"])

await wallet.melt_quote(invoice_payment_request)
inputs_payload = [p.to_dict() for p in wallet.proofs]
keep, send = await wallet.split_to_send(wallet.proofs, 62)
inputs_payload = [p.to_dict() for p in send]

# outputs for change
secrets, rs, derivation_paths = await wallet.generate_n_secrets(1)
Expand All @@ -181,9 +182,6 @@ async def test_melt(ledger: Ledger, wallet: Wallet):
result = response.json()
assert result.get("preimage") is not None
assert result["paid"] is True
assert result["change"]
# we get back 2 sats because it was an internal invoice
assert result["change"][0]["amount"] == 2


@pytest.mark.asyncio
Expand Down

0 comments on commit f5ced37

Please sign in to comment.