Skip to content

Commit cbf30bb

Browse files
cdeckerclaude
andcommitted
gl-testing/tests: decode bolt11 via the node's RPC, drop bitstring<4 stopgap
pyln.proto.Invoice.decode uses bitstring.ConstBitStream, removed in bitstring >= 4.1, which broke test_lsps_plugin_calls. Decode the LSP invoice with the CLN node's own decode RPC instead and remove the bitstring<4 pin so the suite runs on the current bitstring. Full pyln renovation stays tracked separately (GRN-VCJG). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3695f50 commit cbf30bb

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

‎libs/gl-client-py/tests/test_plugin.py‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,14 +228,17 @@ def test_lsps_plugin_calls(clients, bitcoind, node_factory, lsps_server):
228228

229229
# Try the pyo3 bindings from gl-client-py
230230
res = s.lsp_invoice(label="lbl2", description="description", amount_msat=31337)
231-
from pyln.proto import Invoice
232231

233-
inv = Invoice.decode(res.bolt11)
234-
pprint(inv)
232+
# Decode with the CLN node's own decoder rather than pyln.proto's
233+
# Invoice.decode, which uses bitstring.ConstBitStream (removed in
234+
# bitstring >= 4.1).
235+
decoded = r1.rpc.decode(res.bolt11)
236+
pprint(decoded)
235237
# Only one routehint, with only one hop, the LSP to the destination
236-
assert len(inv.route_hints.route_hints) == 1
237-
rh = inv.route_hints.route_hints[0]
238-
assert rh.pubkey == bytes.fromhex(lsp_id)
238+
routes = decoded.get("routes", decoded.get("route_hints", []))
239+
assert len(routes) == 1
240+
hop = routes[0][0] if isinstance(routes[0], list) else routes[0]
241+
assert hop.get("pubkey", hop.get("node_id")) == lsp_id
239242

240243
# The response should include the LSP opening fee computed from
241244
# the LSPS2 fee parameters (min_fee_msat=1000, proportional=1000).

‎libs/gl-testing/pyproject.toml‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@ dependencies = [
2020
"sonora>=0.2.3",
2121
"cln-version-manager",
2222
"bip39>=0.0.2",
23-
# Stopgap: bitstring >=4.1 removed ConstBitStream, which pyln 24.2's
24-
# pyln.proto still uses. Cap it so the test env stays resolvable until we
25-
# renovate pyln to the 26.6 line (see GRN-VCJG), which drops this pin.
26-
"bitstring<4",
2723
]
2824

2925

0 commit comments

Comments
 (0)