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

Function test_bwatch_outpoint_watch

tests/test_plugin.py:5255–5271  ·  view source on GitHub ↗

Test outpoint watch datastore operations

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

5253
5254
5255def test_bwatch_outpoint_watch(node_factory, bitcoind):
5256 """Test outpoint watch datastore operations"""
5257 l1 = node_factory.get_node(options=BWATCH_OPTS)
5258 test_txid = "4" * 64
5259 test_outpoint = f"{test_txid}:0"
5260
5261 l1.rpc.addoutpointwatch(owner='wallet/p2wpkh/0', outpoint=test_outpoint, start_block=100)
5262
5263 # Verify it's in the datastore (use any() since wallet may have its own outpoints)
5264 ds = l1.rpc.listdatastore(['bwatch', 'outpoint'])
5265 assert any(d['key'] == ['bwatch', 'outpoint', test_outpoint] for d in ds['datastore'])
5266
5267 # Remove it
5268 l1.rpc.deloutpointwatch(owner='wallet/p2wpkh/0', outpoint=test_outpoint)
5269
5270 ds = l1.rpc.listdatastore(['bwatch', 'outpoint'])
5271 assert not any(d['key'] == ['bwatch', 'outpoint', test_outpoint] for d in ds['datastore'])
5272
5273
5274def test_bwatch_rescan_triggered_for_past_start_block(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