Skip to content

Commit e8b34e3

Browse files
committed
sql: add test that triggers bug on channelmoves
Updating channelmoves table makes sql to crash if there are more elements in listchannelmoves than limit_per_list. Changelog-None Signed-off-by: Lagrang3 <lagrang3@protonmail.com>
1 parent 9e31954 commit e8b34e3

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/test_plugin.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4410,6 +4410,17 @@ def test_sql_deprecated(node_factory, bitcoind):
44104410
assert ret == {'rows': [[1]]}
44114411

44124412

4413+
@pytest.mark.xfail(strict=True)
4414+
def test_sql_limit_per_list(node_factory):
4415+
l1, l2, l3 = node_factory.line_graph(
4416+
3, wait_for_announce=True, opts=[{}, {"dev-sqllistlimit": 10}, {}]
4417+
)
4418+
for i in range(20):
4419+
inv = l3.rpc.invoice(1000, f"inv-{i}", f"inv-{i}")["bolt11"]
4420+
l1.rpc.xpay(inv)
4421+
l2.rpc.sql("SELECT created_index, payment_hash FROM channelmoves")
4422+
4423+
44134424
def test_plugin_persist_option(node_factory):
44144425
"""test that options from config file get remembered across plugin stop/start"""
44154426
plugin_path = os.path.join(os.getcwd(), 'contrib/plugins/helloworld.py')

0 commit comments

Comments
 (0)