mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 21:35:11 +01:00
pytest: test starting with db corrupted by dangling peer.
db was taken from the failed test. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
7887e5c00a
commit
594f260de7
BIN
tests/data/dangling-peer.sqlite3.xz
Normal file
BIN
tests/data/dangling-peer.sqlite3.xz
Normal file
Binary file not shown.
20
tests/test_db.py
Normal file
20
tests/test_db.py
Normal file
@ -0,0 +1,20 @@
|
||||
from fixtures import * # noqa: F401,F403
|
||||
|
||||
import pytest
|
||||
|
||||
|
||||
@pytest.mark.xfail(strict=True)
|
||||
def test_db_dangling_peer_fix(node_factory):
|
||||
# This was taken from test_fail_unconfirmed() node.
|
||||
l1 = node_factory.get_node(dbfile='dangling-peer.sqlite3.xz')
|
||||
l2 = node_factory.get_node()
|
||||
|
||||
# Must match entry in db
|
||||
assert l2.info['id'] == '022d223620a359a47ff7f7ac447c85c46c923da53389221a0054c11c1e3ca31d59'
|
||||
|
||||
# This time it should work! (Connect *in* since l1 thinks it has UTXOs
|
||||
# it doesn't have).
|
||||
l1.rpc.connect(l2.info['id'], 'localhost', l2.port)
|
||||
# Make sure l2 has register connection
|
||||
l2.daemon.wait_for_log('Handed peer, entering loop')
|
||||
l2.fund_channel(l1, 200000, wait_for_active=True)
|
Loading…
Reference in New Issue
Block a user