Skip to content

Commit

Permalink
tests: Add test_getemergencyrecoverdata to test the RPC getemergencyr…
Browse files Browse the repository at this point in the history
…ecoverdata.
  • Loading branch information
adi2011 authored and ShahanaFarooqui committed Oct 4, 2024
1 parent 2be7433 commit 27b4a03
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2869,6 +2869,18 @@ def test_recoverchannel(node_factory):
assert stubs[0] == "c3a7b9d74a174497122bc52d74d6d69836acadc77e0429c6d8b68b48d5c9139a"


def test_getemergencyrecoverdata(node_factory):
"""
Test getemergencyrecoverdata
"""
l1 = node_factory.get_node()
filedata = l1.rpc.getemergencyrecoverdata()['filedata']

with open(os.path.join(l1.daemon.lightning_dir, TEST_NETWORK, "emergency.recover"), "rb") as f:
lines = f.read().hex()
assert lines == filedata


@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "deletes database, which is assumed sqlite3")
def test_emergencyrecover(node_factory, bitcoind):
"""
Expand Down

0 comments on commit 27b4a03

Please sign in to comment.