auto.sourcefree should also apply to layer-created channels
(node_factory, bitcoind)
| 1299 | |
| 1300 | |
| 1301 | def test_sourcefree_on_mods(node_factory, bitcoind): |
| 1302 | """auto.sourcefree should also apply to layer-created channels""" |
| 1303 | gsfile, nodemap = generate_gossip_store([GenChannel(0, 1, forward=GenChannel.Half(propfee=10000)), |
| 1304 | GenChannel(0, 2, forward=GenChannel.Half(propfee=10000))]) |
| 1305 | |
| 1306 | l1 = node_factory.get_node(gossip_store_file=gsfile.name) |
| 1307 | |
| 1308 | # Add a local channel from 0->l1 (we just needed a nodeid). |
| 1309 | l1.rpc.askrene_create_layer('test_layers') |
| 1310 | l1.rpc.askrene_create_channel('test_layers', |
| 1311 | nodemap[0], |
| 1312 | l1.info['id'], |
| 1313 | '0x3x3', |
| 1314 | '1000000sat') |
| 1315 | l1.rpc.askrene_update_channel(layer='test_layers', |
| 1316 | short_channel_id_dir=f'0x3x3/{direction(nodemap[0], l1.info["id"])}', |
| 1317 | enabled=True, |
| 1318 | htlc_minimum_msat=100, |
| 1319 | htlc_maximum_msat='900000sat', |
| 1320 | fee_base_msat=1000, |
| 1321 | fee_proportional_millionths=2000, |
| 1322 | cltv_expiry_delta=18) |
| 1323 | dir03 = direction(nodemap[0], l1.info['id']) |
| 1324 | routes = l1.rpc.getroutes(source=nodemap[0], |
| 1325 | destination=l1.info['id'], |
| 1326 | amount_msat=1000000, |
| 1327 | layers=['test_layers', 'auto.sourcefree'], |
| 1328 | maxfee_msat=100000, |
| 1329 | final_cltv=99)['routes'] |
| 1330 | # Expect no fee. |
| 1331 | check_route_as_expected(routes, [[{'short_channel_id_dir': f'0x3x3/{dir03}', |
| 1332 | 'amount_in_msat': 1000000, 'cltv_in': 99}]]) |
| 1333 | |
| 1334 | # NOT if we specify layers in the other order! |
| 1335 | routes = l1.rpc.getroutes(source=nodemap[0], |
| 1336 | destination=l1.info['id'], |
| 1337 | amount_msat=1000000, |
| 1338 | layers=['auto.sourcefree', 'test_layers'], |
| 1339 | maxfee_msat=100000, |
| 1340 | final_cltv=99)['routes'] |
| 1341 | # Expect no fee. |
| 1342 | check_route_as_expected(routes, [[{'short_channel_id_dir': f'0x3x3/{dir03}', |
| 1343 | 'amount_in_msat': 1003000, 'cltv_in': 117}]]) |
| 1344 | |
| 1345 | |
| 1346 | def test_live_spendable(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected