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

Function test_pay0

tests/test_pay.py:209–229  ·  view source on GitHub ↗

Test paying 0 amount

(node_factory)

Source from the content-addressed store, hash-verified

207
208
209def test_pay0(node_factory):
210 """Test paying 0 amount
211 """
212 l1, l2 = node_factory.line_graph(2)
213 chanid = l1.get_channel_scid(l2)
214
215 # Get any-amount invoice
216 inv = l2.rpc.invoice("any", "any", 'description')
217 rhash = inv['payment_hash']
218
219 routestep = {
220 'amount_msat': 0,
221 'id': l2.info['id'],
222 'delay': 10,
223 'channel': chanid
224 }
225
226 # Amount must be nonzero!
227 l1.rpc.sendpay([routestep], rhash, payment_secret=inv['payment_secret'])
228 with pytest.raises(RpcError, match=r'WIRE_AMOUNT_BELOW_MINIMUM'):
229 l1.rpc.waitsendpay(rhash)
230
231
232def test_pay_disconnect(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 5

line_graphMethod · 0.80
get_channel_scidMethod · 0.80
sendpayMethod · 0.80
waitsendpayMethod · 0.80
invoiceMethod · 0.45

Tested by

no test coverage detected