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

Function test_id_migration

tests/test_runes.py:665–679  ·  view source on GitHub ↗

Database was taken from test_createrune

(node_factory)

Source from the content-addressed store, hash-verified

663@unittest.skipIf(os.getenv('TEST_DB_PROVIDER', 'sqlite3') != 'sqlite3', "This test is based on a sqlite3 snapshot")
664@unittest.skipIf(TEST_NETWORK != 'regtest', "The DB migration is network specific due to the chain var.")
665def test_id_migration(node_factory):
666 """Database was taken from test_createrune"""
667 l1 = node_factory.get_node(dbfile='runes_bad_id.sqlite3.xz',
668 options={'database-upgrade': True},
669 old_hsmsecret=True)
670
671 for rune in ('OSqc7ixY6F-gjcigBfxtzKUI54uzgFSA6YfBQoWGDV89MA==',
672 'zm0x_eLgHexaTvZn3Cz7gb_YlvrlYGDo_w4BYlR9SS09MSZtZXRob2RebGlzdHxtZXRob2ReZ2V0fG1ldGhvZD1zdW1tYXJ5Jm1ldGhvZC9saXN0ZGF0YXN0b3Jl',
673 'mxHwVsC_W-PH7r79wXQWqxBNHaHncIqIjEPyP_vGOsE9MiZ0aW1lPjE2NTY2NzUyMTE=',
674 'YPojv9qgHPa3im0eiqRb-g8aRq76OasyfltGGqdFUOU9MyZpZF4wMjJkMjIzNjIwYTM1OWE0N2ZmNyZtZXRob2Q9bGlzdHBlZXJz',
675 'enX0sTpHB8y1ktyTAF80CnEvGetG340Ne3AGItudBS49NCZwbnVtPTA='):
676 assert 'stored' not in only_one(l1.rpc.showrunes(rune)['runes'])
677
678 # Our migration should have removed this row now
679 assert l1.db_query("SELECT * FROM vars WHERE name = 'runes_uniqueid';") == []
680
681
682def test_rune_error_messages(node_factory):

Callers

nothing calls this directly

Calls 3

only_oneFunction · 0.90
db_queryMethod · 0.80
get_nodeMethod · 0.45

Tested by

no test coverage detected