|
@ -926,10 +926,16 @@ class LightningDTests(BaseLightningDTests): |
|
|
|
|
|
|
|
|
inv = l2.rpc.invoice(123000, 'test_pay', 'description')['bolt11'] |
|
|
inv = l2.rpc.invoice(123000, 'test_pay', 'description')['bolt11'] |
|
|
before = int(time.time()) |
|
|
before = int(time.time()) |
|
|
preimage = l1.rpc.pay(inv) |
|
|
details = l1.rpc.pay(inv) |
|
|
after = int(time.time()) |
|
|
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['status'] == 'paid' |
|
|
assert invoice['paid_at'] >= before |
|
|
assert invoice['paid_at'] >= before |
|
|
assert invoice['paid_at'] <= after |
|
|
assert invoice['paid_at'] <= after |
|
@ -957,7 +963,7 @@ class LightningDTests(BaseLightningDTests): |
|
|
|
|
|
|
|
|
# Test listpayments indexed by bolt11. |
|
|
# Test listpayments indexed by bolt11. |
|
|
assert len(l1.rpc.listpayments(inv)['payments']) == 1 |
|
|
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): |
|
|
def test_pay_optional_args(self): |
|
|
l1, l2 = self.connect() |
|
|
l1, l2 = self.connect() |
|
|