MCPcopy Create free account
hub / github.com/ElementsProject/lightning / test_amountless_invoice

Function test_amountless_invoice

tests/test_invoices.py:616–634  ·  view source on GitHub ↗

The recipient should know how much was received by an amountless invoice.

(node_factory)

Source from the content-addressed store, hash-verified

614
615
616def test_amountless_invoice(node_factory):
617 """The recipient should know how much was received by an amountless invoice.
618 """
619 l1, l2 = node_factory.line_graph(2)
620
621 inv = l2.rpc.invoice('any', 'lbl', 'desc')['bolt11']
622 i = l2.rpc.listinvoices()['invoices']
623 assert(len(i) == 1)
624 assert('amount_received_msat' not in i[0])
625 assert(i[0]['status'] == 'unpaid')
626 details = l1.rpc.decode(inv)
627 assert('msatoshi' not in details)
628
629 l1.rpc.xpay(inv, amount_msat=1337)
630
631 i = l2.rpc.listinvoices()['invoices']
632 assert(len(i) == 1)
633 assert(i[0]['amount_received_msat'] == Millisatoshi(1337))
634 assert(i[0]['status'] == 'paid')
635
636
637def test_listinvoices_filter(node_factory):

Callers

nothing calls this directly

Calls 6

MillisatoshiClass · 0.90
line_graphMethod · 0.80
invoiceMethod · 0.45
listinvoicesMethod · 0.45
decodeMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected