From ea1cea63661ba0356bc915478479fdd48489d33b Mon Sep 17 00:00:00 2001 From: ZmnSCPxj Date: Tue, 19 Dec 2017 12:46:59 +0000 Subject: [PATCH] wallet: Minor testing of pay_index column. --- tests/test_lightningd.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_lightningd.py b/tests/test_lightningd.py index d59398e49..046d7f646 100644 --- a/tests/test_lightningd.py +++ b/tests/test_lightningd.py @@ -334,6 +334,10 @@ class LightningDTests(BaseLightningDTests): assert b11['expiry'] == 3600 assert b11['payee'] == l1.info['id'] + # Check pay_index is null + outputs = l1.db_query('SELECT pay_index IS NULL AS q FROM invoices WHERE label="label";') + assert len(outputs) == 1 and outputs[0]['q'] != 0 + def test_invoice_expiry(self): l1,l2 = self.connect() @@ -719,6 +723,10 @@ class LightningDTests(BaseLightningDTests): l1.rpc.pay(inv) assert l2.rpc.listinvoice('test_pay')[0]['complete'] == True + # Check pay_index is not null + outputs = l2.db_query('SELECT pay_index IS NOT NULL AS q FROM invoices WHERE label="label";') + assert len(outputs) == 1 and outputs[0]['q'] != 0 + def test_bad_opening(self): # l1 asks for a too-long locktime l1 = self.node_factory.get_node(options=['--locktime-blocks=100'])