Skip to content

Commit

Permalink
tests: Add explicit preapprove{invoice,keysend} calls before sendpay
Browse files Browse the repository at this point in the history
  • Loading branch information
ksedgwic committed Nov 11, 2023
1 parent 6a6a0c0 commit b4df02a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/test_closing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3951,6 +3951,7 @@ def test_peer_anchor_push(node_factory, bitcoind, executor, chainparams):
amt = 100_000_000
sticky_inv = l3.rpc.invoice(amt, 'sticky', 'sticky')
route = l1.rpc.getroute(l3.info['id'], amt, 1)['route']
l1.rpc.preapproveinvoice(bolt11=sticky_inv['bolt11']) # let the signer know this payment is coming
l1.rpc.sendpay(route, sticky_inv['payment_hash'], payment_secret=sticky_inv['payment_secret'])
l3.daemon.wait_for_log('dev_disconnect: -WIRE_UPDATE_FULFILL_HTLC')

Expand Down
2 changes: 2 additions & 0 deletions tests/test_pay.py
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@ def test_repay(node_factory):
'delay': 5,
'channel': first_scid(l1, l2)
}
l1.rpc.preapproveinvoice(bolt11=inv['bolt11']) # let the signer know this payment is coming
l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret'])
l1.daemon.wait_for_log("Sending 200000000msat over 1 hops to deliver 200000000msat")
l1.rpc.waitsendpay(inv['payment_hash'])['payment_preimage']
Expand Down Expand Up @@ -739,6 +740,7 @@ def test_wait_sendpay(node_factory, executor):
'delay': 5,
'channel': first_scid(l1, l2)
}
l1.rpc.preapproveinvoice(bolt11=inv['bolt11']) # let the signer know this payment is coming
l1.rpc.sendpay([routestep], inv['payment_hash'], payment_secret=inv['payment_secret'])
assert wait_created.result(TIMEOUT) == {'subsystem': 'sendpays',
'created': 1,
Expand Down

0 comments on commit b4df02a

Please sign in to comment.