@@ -24,7 +24,8 @@ def test_invoice(node_factory, chainparams):
2424 l1 .daemon .wait_for_log (r': "{}:invoice#[0-9]*/cln:listincoming#[0-9]*"\[OUT\]' .format (myname ))
2525
2626 after = int (time .time ())
27- b11 = l1 .rpc .decodepay (inv ['bolt11' ])
27+ b11 = l1 .rpc .decode (inv ['bolt11' ])
28+ assert b11 ['type' ] == 'bolt11 invoice'
2829 assert b11 ['currency' ] == chainparams ['bip173_prefix' ]
2930 assert b11 ['created_at' ] >= before
3031 assert b11 ['created_at' ] <= after
@@ -63,7 +64,7 @@ def test_invoice(node_factory, chainparams):
6364
6465 # Test cltv option.
6566 inv = l1 .rpc .invoice (123000 , 'label3' , 'description' , 3700 , cltv = 99 )
66- b11 = l1 .rpc .decodepay (inv ['bolt11' ])
67+ b11 = l1 .rpc .decode (inv ['bolt11' ])
6768 assert b11 ['min_final_cltv_expiry' ] == 99
6869
6970
@@ -103,7 +104,7 @@ def test_invoice_weirdstring(node_factory):
103104 inv = only_one (l1 .rpc .listinvoices ()['invoices' ])
104105 assert inv ['label' ] == weird_label
105106
106- b11 = l1 .rpc .decodepay (inv ['bolt11' ])
107+ b11 = l1 .rpc .decode (inv ['bolt11' ])
107108 assert b11 ['description' ] == weird_desc
108109
109110 # Can delete by weird label.
@@ -123,7 +124,7 @@ def test_invoice_weirdstring(node_factory):
123124 inv = only_one (l1 .rpc .listinvoices ()['invoices' ])
124125 assert inv ['label' ] == str (weird_label )
125126
126- b11 = l1 .rpc .decodepay (inv ['bolt11' ])
127+ b11 = l1 .rpc .decode (inv ['bolt11' ])
127128 assert b11 ['description' ] == weird_desc
128129
129130 # Can delete by weird label.
@@ -167,7 +168,7 @@ def test_invoice_routeboost(node_factory, bitcoind):
167168 assert 'warning_deadends' not in inv
168169 assert 'warning_mpp' not in inv
169170 # Route array has single route with single element.
170- r = only_one (only_one (l2 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
171+ r = only_one (only_one (l2 .rpc .decode (inv ['bolt11' ])['routes' ]))
171172 assert r ['pubkey' ] == l2 .info ['id' ]
172173 assert r ['short_channel_id' ] == l3 .rpc .listpeerchannels (l2 .info ['id' ])['channels' ][0 ]['short_channel_id' ]
173174 assert r ['fee_base_msat' ] == 1
@@ -241,7 +242,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
241242 assert 'warning_deadends' not in inv
242243 assert 'warning_mpp' not in inv
243244 # Route array has single route with single element.
244- r = only_one (only_one (l1 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
245+ r = only_one (only_one (l1 .rpc .decode (inv ['bolt11' ])['routes' ]))
245246 assert r ['pubkey' ] == l1 .info ['id' ]
246247 # It uses our private alias!
247248 assert r ['short_channel_id' ] != l1 .rpc .listchannels ()['channels' ][0 ]['short_channel_id' ]
@@ -257,7 +258,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
257258 assert 'warning_offline' not in inv
258259 assert 'warning_deadends' not in inv
259260 assert 'warning_mpp' not in inv
260- assert 'routes' not in l1 .rpc .decodepay (inv ['bolt11' ])
261+ assert 'routes' not in l1 .rpc .decode (inv ['bolt11' ])
261262
262263 # If we ask for it, we get it.
263264 inv = l2 .rpc .invoice (amount_msat = 123456 , label = "inv1a" , description = "?" , exposeprivatechannels = scid )
@@ -267,7 +268,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
267268 assert 'warning_deadends' not in inv
268269 assert 'warning_mpp' not in inv
269270 # Route array has single route with single element.
270- r = only_one (only_one (l1 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
271+ r = only_one (only_one (l1 .rpc .decode (inv ['bolt11' ])['routes' ]))
271272 assert r ['pubkey' ] == l1 .info ['id' ]
272273 assert r ['short_channel_id' ] == alias
273274 assert r ['fee_base_msat' ] == 1
@@ -282,7 +283,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
282283 assert 'warning_deadends' not in inv
283284 assert 'warning_mpp' not in inv
284285 # Route array has single route with single element.
285- r = only_one (only_one (l1 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
286+ r = only_one (only_one (l1 .rpc .decode (inv ['bolt11' ])['routes' ]))
286287 assert r ['pubkey' ] == l1 .info ['id' ]
287288 assert r ['short_channel_id' ] == alias
288289 assert r ['fee_base_msat' ] == 1
@@ -314,7 +315,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
314315 assert 'warning_deadends' not in inv
315316 assert 'warning_mpp' not in inv
316317 # Route array has single route with single element.
317- r = only_one (only_one (l1 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
318+ r = only_one (only_one (l1 .rpc .decode (inv ['bolt11' ])['routes' ]))
318319 assert r ['pubkey' ] == l1 .info ['id' ]
319320 assert r ['short_channel_id' ] == alias
320321 assert r ['fee_base_msat' ] == 1
@@ -328,7 +329,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
328329 assert 'warning_deadends' not in inv
329330 assert 'warning_mpp' not in inv
330331 # Route array has single route with single element.
331- r = only_one (only_one (l1 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
332+ r = only_one (only_one (l1 .rpc .decode (inv ['bolt11' ])['routes' ]))
332333 assert r ['pubkey' ] == l1 .info ['id' ]
333334 assert r ['short_channel_id' ] == alias
334335 assert r ['fee_base_msat' ] == 1
@@ -351,7 +352,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
351352 assert 'warning_deadends' not in inv
352353 assert 'warning_mpp' not in inv
353354 # Route array has single route with single element.
354- r = only_one (only_one (l1 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
355+ r = only_one (only_one (l1 .rpc .decode (inv ['bolt11' ])['routes' ]))
355356 assert r ['pubkey' ] == l1 .info ['id' ]
356357 assert r ['short_channel_id' ] == alias
357358 assert r ['fee_base_msat' ] == 1
@@ -371,7 +372,7 @@ def test_invoice_routeboost_private(node_factory, bitcoind):
371372 assert 'warning_deadends' not in inv
372373 assert 'warning_mpp' not in inv
373374 # Route array has single route with single element.
374- r = only_one (only_one (l1 .rpc .decodepay (inv ['bolt11' ])['routes' ]))
375+ r = only_one (only_one (l1 .rpc .decode (inv ['bolt11' ])['routes' ]))
375376 assert r ['pubkey' ] == l1 .info ['id' ]
376377 assert r ['short_channel_id' ] == alias
377378 assert r ['fee_base_msat' ] == 1
@@ -535,11 +536,11 @@ def test_signinvoice(node_factory, executor):
535536
536537 # Create an invoice for l1
537538 inv1 = l1 .rpc .invoice (1000 , 'inv1' , 'inv1' )['bolt11' ]
538- assert l1 .rpc .decodepay (inv1 )['payee' ] == l1 .info ['id' ]
539+ assert l1 .rpc .decode (inv1 )['payee' ] == l1 .info ['id' ]
539540
540541 # Have l2 re-sign the invoice
541542 inv2 = l2 .rpc .signinvoice (inv1 )['bolt11' ]
542- assert l1 .rpc .decodepay (inv2 )['payee' ] == l2 .info ['id' ]
543+ assert l1 .rpc .decode (inv2 )['payee' ] == l2 .info ['id' ]
543544
544545
545546def test_waitanyinvoice_reversed (node_factory , executor ):
@@ -570,7 +571,8 @@ def test_waitanyinvoice_reversed(node_factory, executor):
570571def test_decode_unknown (node_factory ):
571572 l1 = node_factory .get_node ()
572573
573- b11 = l1 .rpc .decodepay ('lntb30m1pw2f2yspp5s59w4a0kjecw3zyexm7zur8l8n4scw674w8sftjhwec33km882gsdpa2pshjmt9de6zqun9w96k2um5ypmkjargypkh2mr5d9cxzun5ypeh2ursdae8gxqruyqvzddp68gup69uhnzwfj9cejuvf3xshrwde68qcrswf0d46kcarfwpshyaplw3skw0tdw4k8g6tsv9e8gu2etcvsym36pdjpz04wm9nn96f9ntc3t3h5r08pe9d62p3js5wt5rkurqnrl7zkj2fjpvl3rmn7wwazt80letwxlm22hngu8n88g7hsp542qpl' )
574+ b11 = l1 .rpc .decode ('lntb30m1pw2f2yspp5s59w4a0kjecw3zyexm7zur8l8n4scw674w8sftjhwec33km882gsdpa2pshjmt9de6zqun9w96k2um5ypmkjargypkh2mr5d9cxzun5ypeh2ursdae8gxqruyqvzddp68gup69uhnzwfj9cejuvf3xshrwde68qcrswf0d46kcarfwpshyaplw3skw0tdw4k8g6tsv9e8gu2etcvsym36pdjpz04wm9nn96f9ntc3t3h5r08pe9d62p3js5wt5rkurqnrl7zkj2fjpvl3rmn7wwazt80letwxlm22hngu8n88g7hsp542qpl' )
575+ assert b11 ['type' ] == 'bolt11 invoice'
574576 assert b11 ['currency' ] == 'tb'
575577 assert b11 ['created_at' ] == 1554294928
576578 assert b11 ['payment_hash' ] == '850aeaf5f69670e8889936fc2e0cff3ceb0c3b5eab8f04ae57767118db673a91'
@@ -596,7 +598,7 @@ def test_amountless_invoice(node_factory):
596598 assert (len (i ) == 1 )
597599 assert ('amount_received_msat' not in i [0 ])
598600 assert (i [0 ]['status' ] == 'unpaid' )
599- details = l1 .rpc .decodepay (inv )
601+ details = l1 .rpc .decode (inv )
600602 assert ('msatoshi' not in details )
601603
602604 l1 .rpc .pay (inv , amount_msat = 1337 )
@@ -781,7 +783,7 @@ def test_invoice_deschash(node_factory, chainparams):
781783 inv = l2 .rpc .invoice (42 , 'label' , 'One piece of chocolate cake, one icecream cone, one pickle, one slice of swiss cheese, one slice of salami, one lollypop, one piece of cherry pie, one sausage, one cupcake, and one slice of watermelon' , deschashonly = True )
782784 assert '8yjmdan79s6qqdhdzgynm4zwqd5d7xmw5fk98klysy043l2ahrqs' in inv ['bolt11' ]
783785
784- b11 = l2 .rpc .decodepay (inv ['bolt11' ])
786+ b11 = l2 .rpc .decode (inv ['bolt11' ])
785787 assert 'description' not in b11
786788 assert b11 ['description_hash' ] == '3925b6f67e2c340036ed12093dd44e0368df1b6ea26c53dbe4811f58fd5db8c1'
787789
@@ -864,7 +866,7 @@ def test_unified_invoices(node_factory, executor, bitcoind):
864866 l1 , l2 = node_factory .line_graph (2 , opts = {'invoices-onchain-fallback' : None })
865867 amount_sat = 1000
866868 inv = l1 .rpc .invoice (amount_sat * 1000 , "inv1" , "test_unified_invoices" )
867- b11 = l1 .rpc .decodepay (inv ['bolt11' ])
869+ b11 = l1 .rpc .decode (inv ['bolt11' ])
868870
869871 assert len (b11 ['fallbacks' ]) == 1
870872
0 commit comments