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

Function test_gossip_store_corrupt

tests/test_gossip.py:1624–1635  ·  view source on GitHub ↗
(node_factory, bitcoind)

Source from the content-addressed store, hash-verified

1622
1623
1624def test_gossip_store_corrupt(node_factory, bitcoind):
1625 l2 = setup_gossip_store_test(node_factory, bitcoind, opts=[{}, {'broken_log': 'gossip_store: Moving to gossip_store.corrupt'}, {}])
1626
1627 l2.stop()
1628 # It should truncate this, not leave junk!
1629 with open(os.path.join(l2.daemon.lightning_dir, TEST_NETWORK, 'gossip_store'), 'wb') as f:
1630 f.write(bytearray.fromhex("07deadbeef"))
1631 l2.start()
1632
1633 # Complains, moves.
1634 wait_for(lambda: l2.daemon.is_in_log('gossipd: Cannot upgrade gossip_store version 7'))
1635 assert os.path.exists(os.path.join(l2.daemon.lightning_dir, TEST_NETWORK, 'gossip_store.corrupt'))
1636
1637
1638def test_gossip_store_load_complex(node_factory, bitcoind):

Callers

nothing calls this directly

Calls 7

wait_forFunction · 0.90
setup_gossip_store_testFunction · 0.85
joinMethod · 0.80
is_in_logMethod · 0.80
stopMethod · 0.45
writeMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected