Test the decode option to decode the contents of emergency recovery.
(node_factory, bitcoind)
| 1536 | |
| 1537 | |
| 1538 | def 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") |