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

Function test_bwatch_remove_one_owner_keeps_watch

tests/test_plugin.py:5193–5209  ·  view source on GitHub ↗

Test that removing one owner doesn't remove the watch if others remain

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

5191
5192
5193def 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
5212def test_bwatch_remove_last_owner_deletes_watch(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 3

listdatastoreMethod · 0.80
anyClass · 0.50
get_nodeMethod · 0.45

Tested by

no test coverage detected