Skip to content

Commit

Permalink
tests: ugly workaround for test_pay unbalanced transfer error
Browse files Browse the repository at this point in the history
The problem is that the test first tries w/ a zero amount invoice and
then tries to succeed w/ an explicit amount.  This only works if the
amount is reduced to sub-htlc levels and thus avoids the VLS balance
check.
  • Loading branch information
ksedgwic committed Feb 27, 2024
1 parent e722dae commit a4cd4dd
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ def test_pay(node_factory):
# Must provide an amount!
with pytest.raises(RpcError):
l1.rpc.pay(inv2)
l1.dev_pay(inv2, random.randint(1000, 999999), dev_use_shadow=False)
# WORKAROUND - reduce the possible amount to avoid HTLC creation which
# fails the VLS balance check because the prior invoice was 0 amount.
l1.dev_pay(inv2, random.randint(1000, 499999), dev_use_shadow=False)

# Should see 6 completed payments
assert len(l1.rpc.listsendpays()['payments']) == 6
Expand Down

0 comments on commit a4cd4dd

Please sign in to comment.