mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 13:25:43 +01:00
test_lightningd: Check payment fields of pay return value.
This commit is contained in:
parent
881eb80f6a
commit
6391645b83
@ -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…
Reference in New Issue
Block a user