From e4c343a386ca4d452584729b4900805a8da003e1 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Sun, 12 May 2019 21:27:06 +0200 Subject: [PATCH] elements: Search for the correct address and invoice prefixes Signed-off-by: Christian Decker --- tests/test_invoices.py | 2 +- tests/test_misc.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_invoices.py b/tests/test_invoices.py index d1b47226f..fca783ea9 100644 --- a/tests/test_invoices.py +++ b/tests/test_invoices.py @@ -42,7 +42,7 @@ def test_invoice(node_factory, chainparams): b11 = inv['bolt11'] # Amount usually comes after currency (bcrt in our case), # but an any-amount invoices will have no amount - assert b11.startswith("lnbcrt1") + assert b11.startswith("ln" + chainparams['bip173_prefix']) # By bech32 rules, the last '1' digit is the separator # between the human-readable and data parts. We want # to match the "lnbcrt1" above with the '1' digit as the diff --git a/tests/test_misc.py b/tests/test_misc.py index 0142bf35c..21760bffb 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -438,7 +438,7 @@ def test_bech32_funding(node_factory, chainparams): # fund a bech32 address and then open a channel with it res = l1.openchannel(l2, 20000, 'bech32') address = res['address'] - assert address[0:4] == chainparams['bip173_prefix'] + assert address.startswith(chainparams['bip173_prefix']) # probably overly paranoid checking wallettxid = res['wallettxid']