lightningd: trigger changed wait when delinvoice desconly used.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2023-07-22 17:16:17 +09:30
parent cbdfc75bde
commit 6782c2fef5
5 changed files with 43 additions and 8 deletions

View File

@@ -799,7 +799,7 @@ def test_wait_invoices(node_factory, executor):
# Creating a new on gives us 3, not another 2!
waitfut = executor.submit(l2.rpc.call, 'wait', {'subsystem': 'invoices', 'indexname': 'created', 'nextvalue': 3})
time.sleep(1)
inv = l2.rpc.invoice(42, 'invlabel2', 'invdesc2')
inv = l2.rpc.invoice(42, 'invlabel2', 'invdesc2', deschashonly=True)
waitres = waitfut.result(TIMEOUT)
assert waitres == {'subsystem': 'invoices',
'created': 3,
@@ -807,6 +807,15 @@ def test_wait_invoices(node_factory, executor):
'bolt11': inv['bolt11'],
'status': 'unpaid'}}
# Deleting a description causes updated to fire!
waitfut = executor.submit(l2.rpc.call, 'wait', {'subsystem': 'invoices', 'indexname': 'updated', 'nextvalue': 3})
time.sleep(1)
l2.rpc.delinvoice('invlabel2', status='unpaid', desconly=True)
waitres = waitfut.result(TIMEOUT)
assert waitres == {'subsystem': 'invoices',
'updated': 3,
'details': {'label': 'invlabel2', 'description': 'invdesc2'}}
def test_invoice_deschash(node_factory, chainparams):
l1, l2 = node_factory.line_graph(2)