mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-24 01:24:26 +01:00
benchmark: Add two benchmarks for forwarded payments
We weren't benchmarking them, so do that now.
This commit is contained in:
committed by
Rusty Russell
parent
81f5b89fe3
commit
a44491fff0
@@ -61,6 +61,26 @@ def test_single_payment(node_factory, benchmark):
|
|||||||
benchmark(do_pay, l1, l2)
|
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):
|
def test_invoice(node_factory, benchmark):
|
||||||
l1 = node_factory.get_node()
|
l1 = node_factory.get_node()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user