test: switch invoice tests to use proper bip173 name

Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
William Casarin 2018-01-24 11:44:57 -08:00 committed by Rusty Russell
parent b30fb952e6
commit 0e59e091e7

View File

@ -348,7 +348,7 @@ class LightningDTests(BaseLightningDTests):
inv = l1.rpc.invoice(123000, 'label', 'description') inv = l1.rpc.invoice(123000, 'label', 'description')
after = int(time.time()) after = int(time.time())
b11 = l1.rpc.decodepay(inv['bolt11']) b11 = l1.rpc.decodepay(inv['bolt11'])
assert b11['currency'] == 'tb' assert b11['currency'] == 'bcrt'
assert b11['created_at'] >= before assert b11['created_at'] >= before
assert b11['created_at'] <= after assert b11['created_at'] <= after
assert b11['payment_hash'] == inv['payment_hash'] assert b11['payment_hash'] == inv['payment_hash']
@ -363,13 +363,13 @@ class LightningDTests(BaseLightningDTests):
# Check any-amount invoice # Check any-amount invoice
inv = l1.rpc.invoice("any", 'label2', 'description2') inv = l1.rpc.invoice("any", 'label2', 'description2')
b11 = inv['bolt11'] b11 = inv['bolt11']
# Amount usually comes after currency (tb in our case), # Amount usually comes after currency (bcrt in our case),
# but an any-amount invoices will have no amount # but an any-amount invoices will have no amount
assert b11.startswith("lntb1") assert b11.startswith("lnbcrt1")
# By bech32 rules, the last '1' digit is the separator # By bech32 rules, the last '1' digit is the separator
# between the human-readable and data parts. We want # between the human-readable and data parts. We want
# to match the "lntb1" above with the '1' digit as the # to match the "lnbcrt1" above with the '1' digit as the
# separator, and not for example "lntb1m1....". # separator, and not for example "lnbcrt1m1....".
assert b11.count('1') == 1 assert b11.count('1') == 1
def test_invoice_expiry(self): def test_invoice_expiry(self):