From 38668ad167dea9fc30e5754f48073d446b3bfbd8 Mon Sep 17 00:00:00 2001 From: Ken Sedgwick Date: Wed, 1 Nov 2023 16:23:04 -0700 Subject: [PATCH] tests: Add explicit preapprove{invoice,keysend} calls before sendpay --- tests/test_closing.py | 1 + tests/test_pay.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tests/test_closing.py b/tests/test_closing.py index b2be27219263..a3ed9d9aad86 100644 --- a/tests/test_closing.py +++ b/tests/test_closing.py @@ -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') diff --git a/tests/test_pay.py b/tests/test_pay.py index 2c89b4e0aaa2..e9d668a3a314 100644 --- a/tests/test_pay.py +++ b/tests/test_pay.py @@ -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'] @@ -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,