mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
pytest: always provide payment_secret when making payments.
They're about to become compulsory. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
neil saitug
parent
3f5d5a1de5
commit
4e881e56ce
@@ -30,19 +30,20 @@ def test_single_hop(node_factory, executor):
|
||||
fs = []
|
||||
invoices = []
|
||||
for i in tqdm(range(num_payments)):
|
||||
invoices.append(l2.rpc.invoice(1000, 'invoice-%d' % (i), 'desc')['payment_hash'])
|
||||
inv = l2.rpc.invoice(1000, 'invoice-%d' % (i), 'desc')
|
||||
invoices.append((inv['payment_hash'], inv['payment_secret']))
|
||||
|
||||
route = l1.rpc.getroute(l2.rpc.getinfo()['id'], 1000, 1)['route']
|
||||
print("Sending payments")
|
||||
start_time = time()
|
||||
|
||||
def do_pay(i):
|
||||
p = l1.rpc.sendpay(route, i)
|
||||
def do_pay(i, s):
|
||||
p = l1.rpc.sendpay(route, i, payment_secret=s)
|
||||
r = l1.rpc.waitsendpay(p['payment_hash'])
|
||||
return r
|
||||
|
||||
for i in invoices:
|
||||
fs.append(executor.submit(do_pay, i))
|
||||
for i, s in invoices:
|
||||
fs.append(executor.submit(do_pay, i, s))
|
||||
|
||||
for f in tqdm(futures.as_completed(fs), total=len(fs)):
|
||||
f.result()
|
||||
|
||||
Reference in New Issue
Block a user