Browse Source

test_lightningd: Check payment fields of pay return value.

ppa-0.6.1
ZmnSCPxj 7 years ago
committed by Rusty Russell
parent
commit
6391645b83
  1. 12
      tests/test_lightningd.py

12
tests/test_lightningd.py

@ -926,10 +926,16 @@ class LightningDTests(BaseLightningDTests):
inv = l2.rpc.invoice(123000, 'test_pay', 'description')['bolt11']
before = int(time.time())
preimage = l1.rpc.pay(inv)
details = l1.rpc.pay(inv)
after = int(time.time())
invoice = l2.rpc.listinvoices('test_pay')['invoices'][0]
preimage = details['payment_preimage']
assert details['status'] == 'complete'
assert details['msatoshi'] == 123000
assert details['destination'] == l2.info['id']
assert details['created_at'] >= before
assert details['created_at'] <= after
invoice = l2.rpc.listinvoices('test_pay')['invoices'][0]
assert invoice['status'] == 'paid'
assert invoice['paid_at'] >= before
assert invoice['paid_at'] <= after
@ -957,7 +963,7 @@ class LightningDTests(BaseLightningDTests):
# Test listpayments indexed by bolt11.
assert len(l1.rpc.listpayments(inv)['payments']) == 1
assert l1.rpc.listpayments(inv)['payments'][0]['payment_preimage'] == preimage['payment_preimage']
assert l1.rpc.listpayments(inv)['payments'][0]['payment_preimage'] == preimage
def test_pay_optional_args(self):
l1, l2 = self.connect()

Loading…
Cancel
Save