Test scriptpubkey watch datastore operations
(node_factory, bitcoind)
| 5232 | |
| 5233 | |
| 5234 | def test_bwatch_scriptpubkey_watch(node_factory, bitcoind): |
| 5235 | """Test scriptpubkey watch datastore operations""" |
| 5236 | l1 = node_factory.get_node(options=BWATCH_OPTS) |
| 5237 | |
| 5238 | # A simple P2PKH scriptpubkey — not used by the wallet (which uses P2WPKH/P2TR/P2SH-P2WPKH) |
| 5239 | test_spk = "76a914" + "00" * 20 + "88ac" |
| 5240 | expected_key = ['bwatch', 'scriptpubkey', test_spk] |
| 5241 | |
| 5242 | l1.rpc.addscriptpubkeywatch(owner='wallet/p2wpkh/0', scriptpubkey=test_spk, start_block=100) |
| 5243 | |
| 5244 | # Verify our specific key is in the datastore (wallet also has scriptpubkey entries) |
| 5245 | ds = l1.rpc.listdatastore(['bwatch', 'scriptpubkey']) |
| 5246 | assert any(d['key'] == expected_key for d in ds['datastore']) |
| 5247 | |
| 5248 | # Remove it |
| 5249 | l1.rpc.delscriptpubkeywatch(owner='wallet/p2wpkh/0', scriptpubkey=test_spk) |
| 5250 | |
| 5251 | ds = l1.rpc.listdatastore(['bwatch', 'scriptpubkey']) |
| 5252 | assert not any(d['key'] == expected_key for d in ds['datastore']) |
| 5253 | |
| 5254 | |
| 5255 | def test_bwatch_outpoint_watch(node_factory, bitcoind): |
nothing calls this directly
no test coverage detected