mirror of
https://github.com/aljazceru/lightning.git
synced 2026-02-23 15:04:19 +01:00
sendpay: insist that partid be an exact duplicate if in progress.
The test had part 1 and 2 backward, but still worked. When I copied that to *after* the test had succeeded, it complained. It should always complain, to catch bugs. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Christian Decker
parent
73d5d96d2a
commit
09eb7110e0
@@ -2609,9 +2609,12 @@ def test_partial_payment(node_factory, bitcoind, executor):
|
||||
l1.rpc.sendpay(route=r124, payment_hash=inv['payment_hash'],
|
||||
msatoshi=1000, bolt11=inv['bolt11'], payment_secret=paysecret, partid=3)
|
||||
|
||||
# But repeat is a NOOP.
|
||||
l1.rpc.sendpay(route=r124, payment_hash=inv['payment_hash'], msatoshi=1000, bolt11=inv['bolt11'], payment_secret=paysecret, partid=1)
|
||||
l1.rpc.sendpay(route=r134, payment_hash=inv['payment_hash'], msatoshi=1000, bolt11=inv['bolt11'], payment_secret=paysecret, partid=2)
|
||||
# But repeat is a NOOP, as long as they're exactly the same!
|
||||
with pytest.raises(RpcError, match=r'Already pending with amount 501msat \(not 499msat\)'):
|
||||
l1.rpc.sendpay(route=r124, payment_hash=inv['payment_hash'], msatoshi=1000, bolt11=inv['bolt11'], payment_secret=paysecret, partid=1)
|
||||
|
||||
l1.rpc.sendpay(route=r134, payment_hash=inv['payment_hash'], msatoshi=1000, bolt11=inv['bolt11'], payment_secret=paysecret, partid=1)
|
||||
l1.rpc.sendpay(route=r124, payment_hash=inv['payment_hash'], msatoshi=1000, bolt11=inv['bolt11'], payment_secret=paysecret, partid=2)
|
||||
|
||||
# Make sure they've done the suppress-commitment thing before we unsuppress
|
||||
l2.daemon.wait_for_log(r'dev_disconnect')
|
||||
|
||||
Reference in New Issue
Block a user