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

Function test_rpc_client

tests/test_cln_rs.py:30–39  ·  view source on GitHub ↗
(node_factory, old_hsmsecret, expected_node_id)

Source from the content-addressed store, hash-verified

28 (True, '0266e4598d1d3c415f572a8488830b60f7e744ed9235eb0b1ba93283b315c03518'),
29])
30def test_rpc_client(node_factory, old_hsmsecret, expected_node_id):
31 l1 = node_factory.get_node(old_hsmsecret=old_hsmsecret)
32 bin_path = Path.cwd() / "target" / RUST_PROFILE / "examples" / "cln-rpc-getinfo"
33 rpc_path = Path(l1.daemon.lightning_dir) / TEST_NETWORK / "lightning-rpc"
34 if len(str(rpc_path)) >= 108 and os.uname()[0] == 'Linux':
35 rpc_path = Path('/proc/self/cwd') / os.path.relpath(rpc_path)
36 out = subprocess.check_output([bin_path, rpc_path], stderr=subprocess.STDOUT)
37 # Check that the expected node ID appears in the output
38 assert expected_node_id.encode() in out
39 assert l1.info['id'] == expected_node_id
40
41
42def test_plugin_start(node_factory):

Callers

nothing calls this directly

Calls 2

get_nodeMethod · 0.45
encodeMethod · 0.45

Tested by

no test coverage detected