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

Function test_pay_plugin

tests/test_plugin.py:450–466  ·  view source on GitHub ↗
(node_factory)

Source from the content-addressed store, hash-verified

448
449
450def test_pay_plugin(node_factory):
451 l1, l2 = node_factory.line_graph(2)
452 inv = l2.rpc.invoice(123000, 'label', 'description', 3700)
453
454 res = l1.rpc.pay(bolt11=inv['bolt11'])
455 assert res['status'] == 'complete'
456
457 with pytest.raises(RpcError, match=r'missing required parameter'):
458 l1.rpc.call('pay')
459
460 # Make sure usage messages are present.
461 msg = 'pay invstring [amount_msat] [label] [riskfactor] [maxfeepercent] '\
462 '[retry_for] [maxdelay] [exemptfee] [localinvreqid] [exclude] '\
463 '[maxfee] [description] [partial_msat]'
464 # We run with --developer:
465 msg += ' [dev_use_shadow]'
466 assert only_one(l1.rpc.help('pay')['help'])['command'] == msg
467
468
469def test_keysend_plugin(node_factory):

Callers

nothing calls this directly

Calls 6

only_oneFunction · 0.90
line_graphMethod · 0.80
invoiceMethod · 0.45
payMethod · 0.45
callMethod · 0.45
helpMethod · 0.45

Tested by

no test coverage detected