Skip to content

Commit

Permalink
fees were not returned if the fees were zero
Browse files Browse the repository at this point in the history
  • Loading branch information
callebtc committed Oct 15, 2023
1 parent a7cc210 commit bae5f83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cashu/mint/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ async def melt(

# prepare change to compensate wallet for overpaid fees
return_promises: List[BlindedSignature] = []
if outputs and fee_msat:
if outputs and fee_msat is not None:
return_promises = await self._generate_change_promises(
total_provided=total_provided,
invoice_amount=invoice_amount,
Expand Down
3 changes: 2 additions & 1 deletion tests/test_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,8 @@ async def test_melt(wallet1: Wallet):
await wallet1.pay_lightning(
send_proofs, invoice=invoice.pr, fee_reserve_sat=fee_reserve_sat
)
assert wallet1.balance == 128 - total_amount
# the payment was without fees so we need to remove it from the total amount
assert wallet1.balance == 128 - (total_amount - fee_reserve_sat)


@pytest.mark.asyncio
Expand Down

0 comments on commit bae5f83

Please sign in to comment.