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

Function test_xpay_error_update_fees

tests/test_xpay.py:1278–1307  ·  view source on GitHub ↗

We should process an update inside a temporary_channel_failure

(node_factory)

Source from the content-addressed store, hash-verified

1276
1277
1278def test_xpay_error_update_fees(node_factory):
1279 """We should process an update inside a temporary_channel_failure"""
1280 l1, l2, l3 = node_factory.line_graph(3, fundchannel=True, wait_for_announce=True)
1281
1282 # Don't include any routehints in first invoice.
1283 inv1 = l3.dev_invoice(amount_msat=123000,
1284 label='test_xpay_error_update_fees',
1285 description='description',
1286 dev_routes=[])
1287
1288 inv2 = l3.rpc.invoice(123000, 'test_xpay_error_update_fees2', 'desc')
1289 assert 'routes' not in l1.rpc.decode(inv1['bolt11'])
1290 assert 'routes' in l1.rpc.decode(inv2['bolt11'])
1291
1292 # Make sure l2 doesn't tell l1 directly that channel fee is changed.
1293 l2.rpc.dev_suppress_gossip()
1294 l2.rpc.setchannel(l3.info['id'], 1337, 137, enforcedelay=0)
1295
1296 # Should bounce off and retry...
1297 ret = l1.rpc.xpay(inv1['bolt11'])
1298 assert ret["failed_parts"] == 1
1299 assert ret["successful_parts"] == 1
1300 l1.daemon.wait_for_log('We got fee_insufficient for .*, containing a channel_update: updating our map')
1301
1302 # This will have to do the same, since we don't remember such updates. It will
1303 # even fix the routehint which is (now) wrong.
1304 ret = l1.rpc.xpay(inv2['bolt11'])
1305 assert ret["failed_parts"] == 1
1306 assert ret["successful_parts"] == 1
1307 l1.daemon.wait_for_log('We got fee_insufficient for .*, containing a channel_update: updating our map')
1308
1309
1310def test_xpay_error_update_wrong_channel(node_factory):

Callers

nothing calls this directly

Calls 7

line_graphMethod · 0.80
dev_invoiceMethod · 0.80
setchannelMethod · 0.80
wait_for_logMethod · 0.80
invoiceMethod · 0.45
decodeMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected