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

Function test_xpay_get_error_with_update

tests/test_xpay.py:1245–1275  ·  view source on GitHub ↗

We should process an update inside a temporary_channel_failure

(node_factory)

Source from the content-addressed store, hash-verified

1243
1244
1245def test_xpay_get_error_with_update(node_factory):
1246 """We should process an update inside a temporary_channel_failure"""
1247 l1, l2, l3 = node_factory.line_graph(3, opts={'log-level': 'io'}, fundchannel=True, wait_for_announce=True)
1248 chanid2 = l2.get_channel_scid(l3)
1249
1250 inv = l3.rpc.invoice(123000, 'test_xpay_get_error_with_update', 'description')
1251
1252 # Make sure it's not doing startup any more (where it doesn't disable channels!)
1253 l2.daemon.wait_for_log("channel_gossip: no longer in startup mode", timeout=70)
1254
1255 # Make sure l2 doesn't tell l1 directly that channel is disabled.
1256 l2.rpc.dev_suppress_gossip()
1257 l3.stop()
1258
1259 # Make sure that l2 has seen disconnect, considers channel disabled.
1260 wait_for(lambda: only_one(l2.rpc.listpeerchannels(l3.info['id'])['channels'])['peer_connected'] is False)
1261
1262 assert(l1.is_channel_active(chanid2))
1263
1264 with pytest.raises(RpcError, match=r'temporary_channel_failure'):
1265 l1.rpc.xpay(inv['bolt11'])
1266
1267 # Make sure we get an onionreply, without the type prefix of the nested
1268 # channel_update, and it should patch it to include a type prefix. The
1269 # prefix 0x0102 should be in the channel_update, but not in the
1270 # onionreply (negation of 0x0102 in the RE)
1271 l1.daemon.wait_for_log(rf'Got channel_update from error for {chanid2}/0: 0102')
1272
1273 # But this update is only for this one, not future ones!
1274 time.sleep(5)
1275 assert l1.is_channel_active(chanid2)
1276
1277
1278def test_xpay_error_update_fees(node_factory):

Callers

nothing calls this directly

Calls 10

wait_forFunction · 0.90
only_oneFunction · 0.90
line_graphMethod · 0.80
get_channel_scidMethod · 0.80
wait_for_logMethod · 0.80
listpeerchannelsMethod · 0.80
is_channel_activeMethod · 0.80
invoiceMethod · 0.45
stopMethod · 0.45
xpayMethod · 0.45

Tested by

no test coverage detected