mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-03 10:46:58 +01:00
test_lightningd.py: Test delexpiredinvoice.
This commit is contained in:
parent
3b0081aebb
commit
de853b4847
1 changed files with 11 additions and 0 deletions
|
@ -453,6 +453,7 @@ class LightningDTests(BaseLightningDTests):
|
|||
l2.rpc.invoice('any', 'inv1', 'description', 10)
|
||||
l2.rpc.invoice('any', 'inv2', 'description', 4)
|
||||
l2.rpc.invoice('any', 'inv3', 'description', 16)
|
||||
creation = int(time.time())
|
||||
# Check waitinvoice correctly waits
|
||||
w1 = self.executor.submit(l2.rpc.waitinvoice, 'inv1')
|
||||
w2 = self.executor.submit(l2.rpc.waitinvoice, 'inv2')
|
||||
|
@ -471,6 +472,16 @@ class LightningDTests(BaseLightningDTests):
|
|||
time.sleep(8) # total 20
|
||||
self.assertRaises(ValueError, w3.result)
|
||||
|
||||
# Test delexpiredinvoice
|
||||
l2.rpc.delexpiredinvoice(maxexpirytime=creation + 8)
|
||||
# only inv2 should have been deleted
|
||||
assert len(l2.rpc.listinvoices()['invoices']) == 2
|
||||
assert len(l2.rpc.listinvoices('inv2')['invoices']) == 0
|
||||
# Test delexpiredinvoice all
|
||||
l2.rpc.delexpiredinvoice()
|
||||
# all invoices are expired and should be deleted
|
||||
assert len(l2.rpc.listinvoices()['invoices']) == 0
|
||||
|
||||
def test_connect(self):
|
||||
l1, l2 = self.connect()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue