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

Function pay

tests/test_xpay.py:1632–1639  ·  view source on GitHub ↗
(label, preimage, metadata=None)

Source from the content-addressed store, hash-verified

1630 amount = 100_000
1631
1632 def pay(label, preimage, metadata=None):
1633 inv = payee.rpc.invoice(amount, label, label, preimage=preimage)
1634 if metadata is None:
1635 bolt = inv["bolt11"]
1636 else:
1637 payee.rpc.setmetadatapreimage(preimage=preimage, metadata=metadata.hex())
1638 bolt = bolt11_with_metadata(l1, chainparams, inv, metadata)
1639 return l1.rpc.xpay(bolt, maxfee="80000msat")
1640
1641 ret = pay("plain", "11" * 32)
1642 assert ret["payment_preimage"] == "11" * 32

Callers 1

test_xpay_maxhops_bolt11Function · 0.70

Calls 3

bolt11_with_metadataFunction · 0.85
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected