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

Function test_bwatch_rescan_scriptpubkey

tests/test_plugin.py:5324–5340  ·  view source on GitHub ↗

Test that scriptpubkey watches also trigger rescan

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

5322
5323
5324def test_bwatch_rescan_scriptpubkey(node_factory, bitcoind):
5325 """Test that scriptpubkey watches also trigger rescan"""
5326 l1 = node_factory.get_node(options=BWATCH_OPTS)
5327
5328 # Wait for bwatch to fully sync
5329 l1.daemon.wait_for_log(r'No block change')
5330
5331 info = l1.rpc.getinfo()
5332 current_height = info['blockheight']
5333
5334 test_spk = "76a914" + "11" * 20 + "88ac"
5335 start_block = current_height - 3
5336
5337 l1.rpc.addscriptpubkeywatch(owner='wallet/p2wpkh/0', scriptpubkey=test_spk, start_block=start_block)
5338
5339 l1.daemon.wait_for_log(rf'Starting rescan for scriptpubkey watch: blocks {start_block}-{current_height}')
5340 l1.daemon.wait_for_log(r'Rescan complete')
5341
5342
5343@pytest.mark.slow_test

Callers

nothing calls this directly

Calls 3

wait_for_logMethod · 0.80
get_nodeMethod · 0.45
getinfoMethod · 0.45

Tested by

no test coverage detected