(node_factory, bitcoind)
| 3472 | @pytest.mark.openchannel('v1') |
| 3473 | @pytest.mark.openchannel('v2') |
| 3474 | def test_channel_features(node_factory, bitcoind): |
| 3475 | l1, l2 = node_factory.line_graph(2, fundchannel=False) |
| 3476 | |
| 3477 | bitcoind.rpc.sendtoaddress(l1.rpc.newaddr()['bech32'], 0.1) |
| 3478 | bitcoind.generate_block(1) |
| 3479 | wait_for(lambda: l1.rpc.listfunds()['outputs'] != []) |
| 3480 | |
| 3481 | l1.rpc.fundchannel(l2.info['id'], 'all') |
| 3482 | |
| 3483 | # We should see features in unconfirmed channels. |
| 3484 | chan = only_one(only_one(l1.rpc.listpeers()['peers'])['channels']) |
| 3485 | assert 'option_static_remotekey' in chan['features'] |
| 3486 | if EXPERIMENTAL_FEATURES or l1.config('experimental-dual-fund'): |
| 3487 | assert 'option_anchor_outputs' in chan['features'] |
| 3488 | |
| 3489 | # l2 should agree. |
| 3490 | assert only_one(only_one(l2.rpc.listpeers()['peers'])['channels'])['features'] == chan['features'] |
| 3491 | |
| 3492 | # Confirm it. |
| 3493 | bitcoind.generate_block(1) |
| 3494 | wait_for(lambda: only_one(only_one(l1.rpc.listpeers()['peers'])['channels'])['state'] == 'CHANNELD_NORMAL') |
| 3495 | wait_for(lambda: only_one(only_one(l2.rpc.listpeers()['peers'])['channels'])['state'] == 'CHANNELD_NORMAL') |
| 3496 | |
| 3497 | chan = only_one(only_one(l1.rpc.listpeers()['peers'])['channels']) |
| 3498 | assert 'option_static_remotekey' in chan['features'] |
| 3499 | if EXPERIMENTAL_FEATURES or l1.config('experimental-dual-fund'): |
| 3500 | assert 'option_anchor_outputs' in chan['features'] |
| 3501 | |
| 3502 | # l2 should agree. |
| 3503 | assert only_one(only_one(l2.rpc.listpeers()['peers'])['channels'])['features'] == chan['features'] |
| 3504 | |
| 3505 | |
| 3506 | @pytest.mark.developer("need dev-force-features") |
nothing calls this directly
no test coverage detected