mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-17 19:03:42 +01:00
pytest: test db upgrade.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
91dcd1d55a
commit
714e7fb670
BIN
tests/data/oldstyle-scids.sqlite3.xz
Normal file
BIN
tests/data/oldstyle-scids.sqlite3.xz
Normal file
Binary file not shown.
@ -1,5 +1,7 @@
|
||||
from fixtures import * # noqa: F401,F403
|
||||
from utils import wait_for, sync_blockheight
|
||||
from utils import wait_for, sync_blockheight, COMPAT
|
||||
|
||||
import unittest
|
||||
|
||||
|
||||
def test_db_dangling_peer_fix(node_factory):
|
||||
@ -111,3 +113,13 @@ def test_max_channel_id(node_factory, bitcoind):
|
||||
|
||||
# Fundchannel again, should succeed.
|
||||
l1.rpc.fundchannel(l2.info['id'], 10**5)
|
||||
|
||||
|
||||
@unittest.skipIf(not COMPAT, "needs COMPAT to convert obsolete db")
|
||||
def test_scid_upgrade(node_factory):
|
||||
|
||||
# Created through the power of sed "s/X'\([0-9]*\)78\([0-9]*\)78\([0-9]*\)'/X'\13A\23A\3'/"
|
||||
l1 = node_factory.get_node(dbfile='oldstyle-scids.sqlite3.xz')
|
||||
|
||||
assert l1.db_query('SELECT short_channel_id from channels;') == [{'short_channel_id': '103x1x1'}]
|
||||
assert l1.db_query('SELECT failchannel from payments;') == [{'failchannel': '103x1x1'}]
|
||||
|
@ -42,6 +42,7 @@ EXPERIMENTAL_FEATURES = os.getenv("EXPERIMENTAL_FEATURES", config['EXPERIMENTAL_
|
||||
TIMEOUT = int(os.getenv("TIMEOUT", "60"))
|
||||
VALGRIND = os.getenv("VALGRIND", config['VALGRIND']) == "1"
|
||||
SLOW_MACHINE = os.getenv("SLOW_MACHINE", "0") == "1"
|
||||
COMPAT = os.getenv("COMPAT", config['COMPAT']) == "1"
|
||||
|
||||
|
||||
def wait_for(success, timeout=TIMEOUT):
|
||||
|
Loading…
Reference in New Issue
Block a user