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

Function test_decode

tests/test_misc.py:1538–1551  ·  view source on GitHub ↗

Test the decode option to decode the contents of emergency recovery.

(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

1536
1537
1538def test_decode(node_factory, bitcoind):
1539 """Test the decode option to decode the contents of emergency recovery.
1540 """
1541 l1 = node_factory.get_node()
1542 cmd_line = ["tools/lightning-hsmtool", "getemergencyrecover", os.path.join(l1.daemon.lightning_dir, TEST_NETWORK, "emergency.recover")]
1543 out = subprocess.check_output(cmd_line).decode('utf-8')
1544 bech32_out = out.strip('\n')
1545 assert bech32_out.startswith('clnemerg1')
1546
1547 x = l1.rpc.decode(bech32_out)
1548
1549 assert x["valid"]
1550 assert x["type"] == "emergency recover"
1551 assert x["decrypted"].startswith('17')
1552
1553
1554@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "deletes database, which is assumed sqlite3")

Callers

nothing calls this directly

Calls 3

joinMethod · 0.80
get_nodeMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected