benchmark: Add two benchmarks for forwarded payments

We weren't benchmarking them, so do that now.
This commit is contained in:
Christian Decker
2018-10-12 15:02:58 +02:00
committed by Rusty Russell
parent 81f5b89fe3
commit a44491fff0

View File

@@ -61,6 +61,26 @@ def test_single_payment(node_factory, benchmark):
benchmark(do_pay, l1, l2)
def test_forward_payment(node_factory, benchmark):
l1, l2, l3 = node_factory.line_graph(3, announce=True)
def do_pay(src, dest):
invoice = dest.rpc.invoice(1000, 'invoice-{}'.format(random.random()), 'desc')['bolt11']
src.rpc.pay(invoice)
benchmark(do_pay, l1, l3)
def test_long_forward_payment(node_factory, benchmark):
nodes = node_factory.line_graph(21, announce=True)
def do_pay(src, dest):
invoice = dest.rpc.invoice(1000, 'invoice-{}'.format(random.random()), 'desc')['bolt11']
src.rpc.pay(invoice)
benchmark(do_pay, nodes[0], nodes[-1])
def test_invoice(node_factory, benchmark):
l1 = node_factory.get_node()