Browse Source

benchmark: Add two benchmarks for forwarded payments

We weren't benchmarking them, so do that now.
fee-tracking2
Christian Decker 6 years ago
committed by Rusty Russell
parent
commit
a44491fff0
  1. 20
      tests/benchmark.py

20
tests/benchmark.py

@ -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()

Loading…
Cancel
Save