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

Function test_amounts

tests/test_renepay.py:230–246  ·  view source on GitHub ↗

Check that the amount received matches the amount requested in the invoice.

(node_factory)

Source from the content-addressed store, hash-verified

228
229
230def test_amounts(node_factory):
231 """
232 Check that the amount received matches the amount requested in the invoice.
233 """
234 l1, l2 = node_factory.line_graph(2, opts={'allow-deprecated-apis': True})
235 inv = l2.rpc.invoice(Millisatoshi(123456), "test_pay_amounts", "description")[
236 "bolt11"
237 ]
238
239 invoice = only_one(l2.rpc.listinvoices("test_pay_amounts")["invoices"])
240
241 assert invoice["amount_msat"] == Millisatoshi(123456)
242
243 l1.rpc.call("renepay", {"invstring": inv, "dev_use_shadow": False})
244
245 invoice = only_one(l2.rpc.listinvoices("test_pay_amounts")["invoices"])
246 assert invoice["amount_received_msat"] >= Millisatoshi(123456)
247
248
249def test_limits(node_factory):

Callers

nothing calls this directly

Calls 6

MillisatoshiClass · 0.90
only_oneFunction · 0.90
line_graphMethod · 0.80
invoiceMethod · 0.45
listinvoicesMethod · 0.45
callMethod · 0.45

Tested by

no test coverage detected