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

Function test_xpay_offer

tests/test_xpay.py:961–976  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

959
960
961def test_xpay_offer(node_factory):
962 l1, l2, l3 = node_factory.line_graph(3, wait_for_announce=True)
963
964 offer1 = l3.rpc.offer('any')['bolt12']
965 offer2 = l3.rpc.offer('5sat', "5sat donation")['bolt12']
966
967 with pytest.raises(RpcError, match=r"Must specify amount for this offer"):
968 l1.rpc.xpay(offer1)
969
970 l1.rpc.xpay(offer1, 100)
971
972 with pytest.raises(RpcError, match=r"Offer amount is 5000msat, you tried to pay 1000msat"):
973 l1.rpc.xpay(offer2, 1000)
974
975 l1.rpc.xpay(offer2)
976 l1.rpc.xpay(offer2, 5000)
977
978
979def test_xpay_offer_invoice_amount_mismatch(node_factory):

Callers

nothing calls this directly

Calls 3

line_graphMethod · 0.80
offerMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected