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

Function test_pay_no_secret

tests/test_pay.py:2925–2939  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

2923
2924@unittest.skipIf(TEST_NETWORK != 'regtest', "Invoice is network specific")
2925def test_pay_no_secret(node_factory, bitcoind):
2926 l1, l2 = node_factory.line_graph(2, wait_for_announce=True, opts={'old_hsmsecret': True})
2927
2928 l2.rpc.invoice(100000, "test_pay_no_secret", "test_pay_no_secret",
2929 preimage='00' * 32, expiry=2000000000)
2930
2931 # Produced from modified version (different secret!).
2932 inv_badsecret = 'lnbcrt1u1pwuedm6pp5ve584t0cv27hwmy0cx9ca8uwyqyfw9y9dm3r8vus9fv36r2l9yjsdqaw3jhxazlwpshjhmwda0hxetrwfjhgxq8pmnt9qqcqp9sp52au0npwmw4xxv2rfrat04kh9p3jlmklgavhfxqukx0l05pw5tccs9qypqsqa286dmt2xh3jy8cd8ndeyr845q8a7nhgjkerdqjns76jraux6j25ddx9f5k5r2ey0kk942x3uhaff66794kyjxxcd48uevf7p6ja53gqjj5ur7'
2933 with pytest.raises(RpcError, match=r"Destination said it doesn't know invoice: incorrect_or_unknown_payment_details"):
2934 l1.rpc.xpay(inv_badsecret)
2935
2936 # Produced from old version (no secret!)
2937 inv_nosecret = 'lnbcrt1u1pwue4vapp5ve584t0cv27hwmy0cx9ca8uwyqyfw9y9dm3r8vus9fv36r2l9yjsdqaw3jhxazlwpshjhmwda0hxetrwfjhgxq8pmnt9qqcqp9570xsjyykvssa6ty8fjth6f2y8h09myngad9utesttwjwclv95fz3lgd402f9e5yzpnxmkypg55rkvpg522gcz4ymsjl2w3m4jhw4jsp55m7tl'
2938 with pytest.raises(RpcError, match=r"Invalid bolt11 invoice: Missing required payment secret \(s field\)"):
2939 l1.rpc.xpay(inv_nosecret)
2940
2941
2942def test_shadow_routing(node_factory):

Callers

nothing calls this directly

Calls 3

line_graphMethod · 0.80
invoiceMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected