pay: new all-in-one RPC command.

Closes: #240
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2017-10-26 13:37:19 +10:30
parent d577769350
commit e1dc75e954
2 changed files with 123 additions and 0 deletions

View File

@@ -644,6 +644,22 @@ class LightningDTests(BaseLightningDTests):
# But this should work.
self.pay(l2, l1, available - reserve*2)
def test_pay(self):
l1,l2 = self.connect()
chanid = self.fund_channel(l1, l2, 10**6)
# Wait for route propagation.
bitcoind.rpc.generate(5)
l1.daemon.wait_for_logs(['Received channel_update for channel {}\(0\)'
.format(chanid),
'Received channel_update for channel {}\(1\)'
.format(chanid)])
inv = l2.rpc.invoice(123000, 'test_pay', 'description')['bolt11']
l1.rpc.pay(inv);
assert l2.rpc.listinvoice('test_pay')[0]['complete'] == True
def test_bad_opening(self):
# l1 asks for a too-long locktime
l1 = self.node_factory.get_node(options=['--locktime-blocks=100'])