mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-01-18 05:12:45 +01:00
test: switch invoice tests to use proper bip173 name
Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
parent
b30fb952e6
commit
0e59e091e7
@ -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):
|
||||||
|
Loading…
Reference in New Issue
Block a user