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

Function test_bwatch_blockdepth_watch_remove

tests/test_plugin.py:5855–5875  ·  view source on GitHub ↗

Test that deleting a blockdepth watch removes it from the datastore

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

5853
5854
5855def test_bwatch_blockdepth_watch_remove(node_factory, bitcoind):
5856 """Test that deleting a blockdepth watch removes it from the datastore"""
5857 l1 = node_factory.get_node(options=BWATCH_OPTS)
5858
5859 l1.daemon.wait_for_log(r'No block change')
5860
5861 info = l1.rpc.getinfo()
5862 start_block = info['blockheight']
5863
5864 owner = f"channel/funding_depth/888"
5865 l1.rpc.addblockdepthwatch(owner=owner, start_block=start_block)
5866
5867 # Verify it's present
5868 watches = l1.rpc.listwatch()['watches']
5869 assert any(owner in w.get('owners', []) for w in watches if w.get('type') == 'blockdepth')
5870
5871 # Delete it
5872 l1.rpc.delblockdepthwatch(owner=owner, start_block=start_block)
5873
5874 watches = l1.rpc.listwatch()['watches']
5875 assert not any(owner in w.get('owners', []) for w in watches if w.get('type') == 'blockdepth')
5876
5877
5878def test_bwatch_blockdepth_watch_multiple_owners(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 5

wait_for_logMethod · 0.80
anyClass · 0.50
get_nodeMethod · 0.45
getinfoMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected