Test that removing one owner doesn't remove the watch if others remain
(node_factory, bitcoind)
| 5191 | |
| 5192 | |
| 5193 | def test_bwatch_remove_one_owner_keeps_watch(node_factory, bitcoind): |
| 5194 | """Test that removing one owner doesn't remove the watch if others remain""" |
| 5195 | l1 = node_factory.get_node(options=BWATCH_OPTS) |
| 5196 | |
| 5197 | test_txid = "2" * 64 |
| 5198 | test_outpoint = f"{test_txid}:0" |
| 5199 | |
| 5200 | # Add watch with two owners |
| 5201 | l1.rpc.addoutpointwatch(owner='wallet/p2wpkh/0', outpoint=test_outpoint, start_block=100) |
| 5202 | l1.rpc.addoutpointwatch(owner='wallet/p2tr/0', outpoint=test_outpoint, start_block=100) |
| 5203 | |
| 5204 | # Remove first owner |
| 5205 | l1.rpc.deloutpointwatch(owner='wallet/p2wpkh/0', outpoint=test_outpoint) |
| 5206 | |
| 5207 | # Watch should still exist (wallet/p2tr/0 is still watching) |
| 5208 | ds = l1.rpc.listdatastore(['bwatch', 'outpoint']) |
| 5209 | assert any(d['key'] == ['bwatch', 'outpoint', test_outpoint] for d in ds['datastore']) |
| 5210 | |
| 5211 | |
| 5212 | def test_bwatch_remove_last_owner_deletes_watch(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected